score:2
Accepted answer
For sure you can. You can use TWIRL templates:
Create a template "views/Application/contacts.scala.html
@(users: List[User])
<h1>Users</h1>
<ul>
@for(user <- users) {
<li>@user.name</li>
}
</ul>
in the controller:
Ok(views.html.Application.contacts(users))
Source: stackoverflow.com
Related Query
- Play framework render HTML & values on same page via ajax
- Timing page render in Play 2.0 Scala Framework
- Play Framework 2.4.0 with I18n: two languages in the same page
- Play Framework stay on same page then changing language
- Play Framework + Angular Issue with JSON render on Page
- How to render JSON response in Play framework v2.0 (latest build from GIT)
- How to print @ symbol in HTML with play framework (scala)
- Play framework routes, and scala predef values
- How to show images using Play framework and Scala in the view page
- Better ways to implement more secure Play Scala framework session via cookie
- How to define default values optional fields in play framework forms?
- Escaping HTML in a Java Play Framework Scala Template
- Play Framework 2.2.1 - Compilation error: "method render in class index cannot be applied to given types;"
- Play Framework 2.4.1: How to get configuration values just after configuration file has been loaded
- Play Framework template doesn't have Html type
- JSON reads with hardcoded values in Play framework (Scala)
- avoid executing the same method in all scala actions in play framework
- How to format input values in Play framework 2?
- Null values in JsObject for Option using play framework 2.1
- How to stream zipped file (on the fly) via Play Framework 2.5 in scala?
- Play Framework async controller blocks subsequent calls for the same controller
- Play framework 2.0: Store values in Http.Context
- Why Eclipse shows error with Play Framework render method?
- How can one set up a Play Framework 404 (OnHandlerNotFound) page in Play 2.2?
- AJAX file upload in Play Framework 2.1 RC1 delivers an empty file
- Play Framework send message via rabbit mq
- After application logout click on back button enter to application page in play framework
- Why can I not mix Scala code with HTML here in Play Framework 2 views?
- Play Framework - how do I redirect to a page generated by a plugin controller? [SecureSocial]
- Preserve null values in array of Play framework form mapping
More Query from same tag
- How to express type bound that forces the type param to behave like functor
- Can a make a Scala trait with a polymorphic, variable-arity abstract method?
- Pattern matching and recursion issue
- Lazy solution to fold on Stream algorithm (take K elements from result should consume only Q elements from input)
- How can I use the Scala sttp FetchBackend for handling JavaScript in html?
- How to handle exceptions matching to separate function in scala
- DistributedPubSubMediator Subscription via Proxy Actor not working
- Get a Map[enum, String] from a Java enum with a String field in Scala (Play Framework)?
- Is there a convenient helper in Play 2.4.x to build a uri from play.api.mvc.Request.queryString
- No parameter and by-name params eta expansion confusion in Scala
- Is it a good design if making a lot of function aliases and combine them anywhere?
- Check the Metastore for the Table availability in Spark
- How to release a Scala library to Maven Central using sbt?
- How to use the method getOrCreate of SparkContext class in spark-core version 1.6.0?
- Access private field of inner classes
- Eclipse Scala IDE: How to build standalone Scala app?
- Language selector in Play 2.4 & Scala 2.11.6
- Dropping MySQL table with SparkSQL
- AffinityKeyMapped not working with Ignite 2.4/2.5/2.6 and Scala
- Akka: How to ensure that message has been received?
- Scala type parameter error, not a member of type parameter
- converting streams to blocks of strings and vice-versa
- Unable to automate keytab generation
- Shapeless narrow type loss
- Alternative to doing lots of calculations in constructor - scala
- Using scala parallelism when iterating over a java converted List to immutable
- Returning <Case Class>.type with Case Class
- Scala Syntax Help Currying
- Scala RDF4J application won't terminate
- parsing a filter condition with regular expressions