playframework/twirl là dự án mã nguồn mở trên GitHub, viết chủ yếu bằng Scala, với 561 sao. Twirl is Play's default template engine
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Replacing the LATEST_VERSION with the latest version published, which should be . And enable the plugin on projects using:
someProject.enablePlugins(SbtTwirl)
If you only have a single project and are using a build.sbt file, create a
root project and enable the twirl plugin like this:
lazy val root = (project in file(".")).enablePlugins(SbtTwirl)
Template files
Twirl template files are expected to be placed under src/main/twirl or
src/test/twirl, similar to scala or java sources. The source locations for
template files can be configured.
Template files must be named {name}.scala.{ext} where ext can be html,
js, xml, or txt.
The Twirl template compiler is automatically added as a source generator for
both the main/compile and test configurations. When you run compile or
Test/compile the Twirl compiler will generate Scala source files from the
templates and then these Scala sources will be compiled along with the rest of
your project.
Additional imports
To add additional imports for the Scala code in template files, use the
templateImports key. For example:
TwirlKeys.templateImports += "org.example._"
Source directories
To configure the source directories where template files will be found, use the
compileTemplates / sourceDirectories key. For example, to have template
sources alongside Scala or Java source files:
Replacing the TWIRL_VERSION with the latest version published, which should be .
Template files
Twirl template files are expected to be placed under src/main/twirl or
src/test/twirl, similar to scala or java sources. The additional source
locations for template files can be configured.
Template files must be named {name}.scala.{ext} where ext can be html,
js, xml, or txt.
Additional imports
To add additional imports for the Scala code in template files, use the
templateImports parameter. For example:
Replacing the LATEST_VERSION with the latest version published, which should be .
Template files
Twirl template files are expected to be placed under src/main/twirl or
src/test/twirl, similar to scala or java sources. The additional source
locations for template files can be configured.
⚠️Please note that the output of the template compilation is Scala source code.
If you use these templates in your Java source files, you must place them in a joint compilation folder (see the Gradle Scala Plugin documentation for details).
The default location for this folder is src/main/scala, but it can be customized.
Template files must be named {name}.scala.{ext} where ext can be html,
js, xml, or txt.
Additional imports
To add additional imports for the Scala code in template files, use the
templateImports key. For example:
sourceSets {
main {
twirl {
templateImports.add("org.example._")
}
}
}
Source directories
To configure the source directories where template files will be found, use the
srcDir method for SourceDirectorySet. For example:
sourceSets {
main {
twirl {
srcDir("app")
}
}
}
Scala version
To configure the Scala version use the scalaVersion property of TwirlExtension (2.13 by default). For example:
twirl {
scalaVersion.set("3")
}
Other properties
Also, you can use the next properties:
sourceSets {
main {
twirl {
// Annotations added to constructors in injectable templates
constructorAnnotations.add("@org.example.MyAnnotation()")
// Defined custom twirl template formats
templateFormats.put("csv", "play.twirl.api.TxtFormat")
// Source encoding for template files and generated scala files
sourceEncoding.set("<enc>")
}
}
}
Snapshots
To use a snapshot version add the Maven Central Snapshot repository into settings.gradle.kts:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/playframework/twirl là nguồn chính thức.
playframework/twirl có bao nhiêu sao?
playframework/twirl có 561 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/playframework/twirl. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
playframework/twirl có phải mã nguồn mở không?
Có — playframework/twirl phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/playframework/twirl.
playframework/twirl còn đang phát triển không?
Commit gần nhất trên playframework/twirl là 14 ngày trước (theo timestamp GitHub). Repo có 118 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
playframework/twirl dùng license gì?
playframework/twirl phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
playframework/twirl là gì?
playframework/twirl (playframework/twirl) là dự án Scala trên GitHub. Theo mô tả gốc: Twirl is Play's default template engine
playframework/twirl viết bằng ngôn ngữ gì?
playframework/twirl chủ yếu viết bằng Scala. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về twirl?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về twirl.