Change default path on Symfony CMF

337 views Asked by At

I installed Symfony CMF structure bundles on my project, but default route is on

localhost/project/web/app_dev.php/

and i want to show it on

localhost/project/web/app_dev.php/cms

Thank you!!

2

There are 2 answers

1
devilcius On

Not sure if I understood your question. If you want your default home page at localhost/project/web/app_dev.php/ pointing to your cmf bundle, just add this at the begining of app/config/routing.yml

homepage:
    pattern: /
    defaults: { _controller: YourCMFBundle:Welcome:index }

Where Welcome is the name of your CMF default controller.

4
dbu On

So you do want to install symfony at the webroot, right? If that is the case, your best bet is to add a route /cms and add everything else under that route, instead of directly to the root. When using the RoutingAutoBundle, this should be no problem to configure. If your editors create routes themselves, you would need to work with the widget for selecting the parent of the routes to only propose the cms/ route you created - unless you think it could make sense for them to occasionally place a route outside of /cms.

If you want to be more strict, i think your best bet is the upcoming ResourceBundle. Discuss this with Dan over at https://groups.google.com/forum/#!topic/symfony-cmf-devs/6Wha2o3qHPE