Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

play 2 different package for views

I am trying to move my views out of the default views package into mynewpackage.view.xyz. It was not a problem with the controllers.

It seems like they are not compiled at all.

Play 2.0 doc says:

... Note that in Play 2.0, the controllers, models and views package name conventions are now just that and can be changed if needed (such as prefixing everything with com.yourcompany). ...

What am I doing wrong?

like image 202
eventhorizon Avatar asked May 05 '12 15:05

eventhorizon


1 Answers

  1. Create new package in /app let's call it com.mycompany.views
  2. Create new view in it: myView.scala.html
  3. Return it in action: return ok(com.mycompany.views.html.myView.render());

As can you see there's important html part between package name and view name, to get views compiled without reloading the page start Play with command: play ~run

like image 155
biesior Avatar answered Nov 04 '22 10:11

biesior