2

i am using symfony 1.4.11; use_helper('Url').

On using link_to('new',course/course/type/new), the url it show is ../backend_dev/backend_dev/Course/course/type/new instead of ../backend_dev/Course/course/type/new. Same issue exist for form_tag also.

Edit

Above issue was solved.By setting no_script_name: true at config and clearing cache.

But image_tag(),use_stylesheet() and use_javascript() gives path as for example

use_javascript('jquery-1.6.1.min.js') ==>../web/backend_dev/js/jquery-1.6.1.min.js

instead of

use_javascript('jquery-1.6.1.min.js') ==>../web/js/jquery-1.6.1.min.js

Any help appreciated.

1
  • Did you change your sf_web_dir configuration? What's up with the relative paths? Commented Jun 21, 2011 at 6:36

1 Answer 1

3
+50

Hard to say without your full routing.yml but the one thing i see is that your internal_uri should be expressed as an abs url with a query string like:

link_to('new','/Course/course?type=new');

Note the forward slash at the beginning. Also the module name should be the real module name, not the routed one so if the maodule is /apps/backend/modules/Course then the module in the internal URI should be Course not course same with the action name.

If the route is named then you should use one of the following:

link_to('new','@routename?type=new');

OR

link_to('new','routename', array('type'=>'new'));

Sign up to request clarification or add additional context in comments.

5 Comments

+1,thanks for response,Sir.Please consider the Edit part of the question.
How do you have this configured? backend_dev shoudlnt be a folder it should be a single php file in web ie. backend_dev.php And your Webserver's (or the virtual host's) should map to your web folder.
Sir,there is no backend_dev folder .backend_dev.php file is there in web folder.How to map to web folder in server
Depends on the web server.. if you are using apache then create a virtual host. I usually use custom hostnames instead of different ports... but whatever you prefer...
@Bhanu Krishnan: If you haven't mapped it to a backend_dev/ folder then it wouldn't appear to start with. Do you know if this is a out-of-the-box installation of symfony or have you/someone tweaked the symfony config URLs?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.