views:

122

answers:

1

Hello,

I'm building a site using symfony php framework.

I have a link in my page which leads to page X :

<a href="/X">test</a>

well, the problem is, under my development environment, the link works and the link points to

http://localhost/web/frontend%5Fdev.php/X

but when Im using the production page (index.php) the link turns out to point to :

http://localhost/web/X

when it should point to :

http://localhost/index.php/X

any ideas what the problem is ?

thanks!

A: 

Every link in symfony template should be generated by helper link_to() or url_for(): http://www.symfony-project.org/book/1%5F2/07-Inside-the-View-Layer

frontend_dev.php - is a development version of the front controller. If you are accessing a page via this controller (http://localhost/frontend%5Fdev.php/testmodule/testaction), all links will be processed by this controller. If you will call your site via production controller (index.php, the default one), all links will point via it: (http://localhost/testmodule/testaction): http://www.symfony-project.org/book/1%5F2/06-Inside-the-Controller-Layer

Also, you have incorrect site layout. You shouldn't have any "web" subfolder in the site. Symfony libraries should be put into non-accessible area by browser. You should reread symfony documentation once more. And study this learning-project: http://www.symfony-project.org/jobeet/1%5F2/Doctrine/en/

FractalizeR
Just to clarify a bit: The frontend_dev.php and index.php files are not controllers. They are different entrypoints to two different environments (dev and prod) to the same application (frontend). Controllers are something entirely different.
phidah