Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Organizing templates in sub-directories in Play

Can I organize my view templates in subdirectories in play 2.1?

I get an compiler error if I have a structure something like this: app/views/common/component.scala.html

Thanks!

like image 758
myborobudur Avatar asked Apr 17 '13 10:04

myborobudur


2 Answers

Yes , You can structure your template in sub directory. What error you are getting ?? .You may be getting error due to some other reason. if you use app/views/common/component.scala.html then u can access your template from scala class as views.html.common.component()

From html : @common.component

like image 135
playinscala Avatar answered Nov 08 '22 18:11

playinscala


ok, the import in the controller needs to be import views.html.common.*

like image 11
myborobudur Avatar answered Nov 08 '22 18:11

myborobudur