-3

I am using the Sulu CMS for the my website. As per my requirement I need to create one custom bundle in it.

I tried as the example given documentation :

php app/console generate:bundle 

I followed all the instructions but no success. After creating bundle, I also checked the route using :

php app/console debug:router

Its not showing the routes for the Bundle. Is it possible to trace what is the issue? Any help or reference will be appreciated.

Following is the link of Sulu docs I am referring : http://docs.sulu.io/en/latest/

  • Maybe your bundle doesn't have any routes yet? Can you please describe "no success" in a bit more detail? (do you get an error, does the command error, etc.) Also, did you check the AppKernel to see if your bundle is registered? Sulu is just a Symfony application, so you might want to consider the Symfony Documentation as well. – Wouter J Apr 21 '16 at 09:32
  • The project I am working on is customized, there is no AppKernel. The Whole project is divided in two parts 'admin' and 'front website' and there are now two kernel files. **AdminKernel** and **WebsiteKernel** both are extending the **AbstractKernel**. so when I created module through command line in the normal way, everything went well. But when I check the routes the default routes generated for the bundle was not available. I registered the Bundle, imported the routes in the main file but no success. – tejashsoni111 Apr 21 '16 at 10:34

2 Answers2

0

Do we mention the generate:bundle command somewhere in the documentation? Because unfortunately it's not completely working... It should also say in the output that you have to take some steps on your own. As far as I can remember you have to register the Bundle on your own in one of the kernels: In the AbstractKernel if you want to have it in both kernels, or only in the AdminKernel or WebsiteKernel, that depends on your use case.

Daniel Rotter
  • 1,998
  • 2
  • 16
  • 33
0

When using generate:bundle to create a new bundle symfony will register the routing in app/config/routing.yml, which isn't used by sulu admin nor sulu website.

You can register the bundle routes in app/config/website/routing.yml or app/config/admin/routing.yml depending on your use case.

cioddi
  • 763
  • 4
  • 12