Hello melchior, The behaviour varies depending on the second argument ;
If you use a named route defined in your routing.yml file (i.e. a string starting with '@') or a module/action string, symfony recognizes them as internal URLs. If you want to create a link to another website, you have to type the entire URL, include 'http(s)://...'. So, yes, your first use is a wrong call of the function. In fact I'm surprised symfony didn't throw an error... More information here : http://www.symfony-project.org/api/1_2/UrlHelper#method_link_to Le Mon, 22 Jun 2009 16:06:35 +0200, melchior <[email protected]> a écrit: > > i just found something strange, i try different ways to use link_to > helper with the same options and i don't have the same output result, > if the url is not the same it work correctly but the class parameter > isn't converted into html attributes in the first case, did the first > case a wrong call of the function ? > > <?php echo link_to('Permission','sf_guard_permission',array > ('class'=>"current")); ?> > <?php echo link_to('Permission','@sf_guard_permission',array > ('class'=>"current")); ?> > <?php echo link_to('Permission','sf_guard_permission/index',array > ('class'=>"current")); ?> > > > <a href="/backend_dev.php/sf_guard_permission.html? > class=current">Permission</a> > <a class="current" href="/backend_dev.php/ > sf_guard_permission.html">Permission</a> > <a class="current" href="/backend_dev.php/ > sf_guard_permission">Permission</a> > > > -- Utilisant le client e-mail révolutionnaire d'Opera : http://www.opera.com/mail/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
