Routing Problem With Symfony

eagle

New Member
So I have a module that displays articles. And I tried to make an action that displayed all article of a certain publication when that publication was clicked. I tried following the way to do this on the symfony jobeet tutorials but I ran into some new headaches. Since publications and authors can sometime be url unfriendly, I want to use slugs, and this is where I ran into the problem.So I have an article module and I added a routing rule like this\[code\]publication_articles: url: /publications/:publication_slug class: sfDoctrineRoute param: { module: article, action: publication } options: { model: Article, type: list }\[/code\]I then added a getPublicationSlug() function to the article class that took out spaces and special characters - nothing special. I then added this function to the action class:\[code\] public function executePublication(sfWebRequest $request) { $this->articles = $this->getRoute()->getObjects(); }\[/code\]When I try adding a link like this:\[code\]<a href="http://stackoverflow.com/questions/2038660/<?php echo url_for('publications/'.$article->getPublicationSlug()) ?>"><?php echo $article->getPublication() ?></a>\[/code\]The page returns all the articles without any filtering on the publicationand if i add a link like this: \[code\]<?php echo link_to($article->getPublication(), 'publication_articles', $article) ?>\[/code\]I get this error:\[quote\] The "/publications/:publication_slug" route has some missing mandatory parameters (:publication_slug).\[/quote\]Any ideas? Thanks so much!
 
Back
Top