On Tue, 20 Oct 2009, mbernasocchi wrote: > <?php echo link_to($post->getTitle(), 'post_by_slug', $post) ?>
Shouldn't that second parameter name the route and pass the slug? i.e. link_to($post->getTitle(), '@post_by_slug?slug=' . $post->getSlug()); Im assuming your model has a getSlug() method and named routes usually have a '@' as per the docs: http://www.symfony-project.org/book/1_2/09-Links-and-the-Routing-System#chapter_09_sub_speeding_up_routing_by_using_the_rule_name > my actions.class.php is: > > public function executeShow(sfWebRequest $request) > { > $this->post = $this->getRoute()->getObject(); > } > > and in the showSuccess.php I've: > > <?php echo $bubble->getId() ?> > <?php echo $bubble->getSlug() ?> In your action you sent a variable called $post but then you're using $bubble in the template??? > any Ideas why? as well, I was wondering what does the @ in front of a > route-name mean? when do you use it? if I add it to my link_to I get > an error saying that the route misses the slug. Read the docs on links and routing, chapter 9 of the Definitive Guide. -- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---