Quantcast
Channel: Symfony routing URL works but its wrong - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Symfony routing URL works but its wrong

$
0
0

I have the following I have the following settings at routing.yml:

show_collection:  url:   /:module/collection/:collection  class:   sfDoctrineRoute  options: { model: Category, type: object }  param: { module: collection, action: showcollection }collection:  url:   /collection/  param: { module: collection, action: index }

The link works correctly, however with one problem. The link is this:

frontend_dev.php/collection/showcollection/collection/{name of collection}

So it's making /module/action/module/name_of_collection.What I needed was:

 frontend_dev.php/collection/showcollection/{name of collection}

It would make a lot more sense even though it works as it is now. I already looked at jobeet and other routing tutorials, however I can't figure out what's wrong.

Thanks in advance!

EDIT:

Heres the url_for:

url_for(array('module' => 'collection','action' => 'showcollection','collection' => $collection->getName()))

This is the result:

  .../collection/showcollection/collection/{collection Name}

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images