0

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!!

Lumilo
  • 33
  • 8

2 Answers2

1

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

dbu
  • 1,497
  • 9
  • 8
  • Thanks! I'm not sure how do it..I have a Symfony2 project, and i want install cmf structure on path "mydomain.com/cms" because the default project shouldn't be changed. I'm trying add the MainBundle of https://github.com/symfony-cmf/cmf-sandbox and then i will personalize it. Maybe is not the best way...Thank you so much! – Lumilo Dec 02 '14 at 08:45
  • About adding the cmf to an existing project, have a look at https://github.com/dbu/conference-tutorial/pulls . its step-by-step (only version 1.1, you should replace with 1.2 (resp 1.3 for routing) and check http://symfony.com/doc/master/cmf/index.html for details) – dbu Dec 03 '14 at 15:00
  • Thank you @dbu, finally i introduced the cmf-sandbox and it works. Your recommendations were usefull for me. The last problem is that on prod environment not works...blank page :( Any idea? Thanks! – Lumilo Dec 18 '14 at 11:27
  • You did app/console --env=prod cache:clear, right? You should see errors in either app/logs/prod.log or your apache resp. nginx logfile. That hopefully shows a stacktrace or other useful exception message. With sonata i can't help you much. – dbu Dec 19 '14 at 15:40
0

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.

devilcius
  • 1,764
  • 14
  • 18