0

I have a Play (2.1.2) project that contains a submodule "manager".

I'd like to use the router from my submodule in a template located in the main project.

I tried theses :

@controllers.manager.routes.MyController.method
@controllers.routes.MyController.method
@controllers.routes.manager.MyController.method

Nothing worked.

For information, I followed the tutorial located in the Play documentation :

I have this project structure :

app
  └ controllers
  └ models
  └ views
conf
  └ application.conf
  └ routes
modules
  └ manager
    └ conf/manager.routes
    └ app/controllers
    └ app/models
    └ app/views     
project
 └ build.properties
 └ Build.scala
 └ plugins.sbt

And in the main routes :

->  /admin manager.Routes

Only things I did, was to put my routes in manager.routes without the sub package "manager" (controllers.manager) , I directly named them like in the main project (controllers), for this problem with Eclipse. The same goes for the "package" name in my controllers in my subproject.

Is it possible to use the routes of a sub project in the main project ?

halfer
  • 19,824
  • 17
  • 99
  • 186
Cyril N.
  • 38,875
  • 36
  • 142
  • 243

1 Answers1

0

Yeah it should look like this:

@admin.routes.Application.index

@module.routes.MyController.method
JMParsons
  • 506
  • 2
  • 8