It throws me the exception for line 3. The thing is i have just these lines:
package controllers
import play.api._
import play.api.mvc._
import views._
import models._
object Application extends Controller {
def index = Ok(views.html.index("grrr", "blabla"))
}
EDIT: index.scala.html
@import helper._
@main("Todo") {
<h1>Hello World</h1>
}
I'm using play 2.2.0 on windows xp (with sbt)
I think that problem is with yours line separator in IDE. I once change LF(Linux) to CR(Mac)(by mistake, not knowing that this has an impact on compilation) and struggle with the same problem. After changing to default sperator everything back to normal.
The first line in Play! template is reserved for the signature definition. This is also mentioned in the Welcome screen when you create a new Play Application.
Beside the question why you import the helper._, I would do the following:
play cleanFurther information:
EDIT: 2013.09.24 at 22:15
You are passing two arguments to your view template (views.html.index("grrr", "blabla")), (views are compiled to functions). So in your function (`index view') the first line SHOULD define the function signature (arguments). I think that you should write your template as:
@(firstString : String, secondString : String)
@import helper._
@main("Todo") {
<h1>Hello World</h1>
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With