0
votes

I'd like to generate an URL like this one:

/MyCategory/MySubCategory/page2.html

I have tried to do it this way:

my_route: 
url: /:variable1/:variable2/literal:variable3.html 

But Symfony outputs this:

/MyCategory/MySubCategory/page:variable3.html

I'm using Symfony 1.4.1

How could I solve this?

1
Please show your url_for() or smth relative to thisDarmen Amanbayev

1 Answers

4
votes

Try:

my_route: 
  url: /:variable1/:variable2/:variable3
  param: { module: mymodule, action: myaction }

in SF_APP/config/factories.yml:

prod:
  routing:
    param:
      suffix: .html

Usage:

<?php echo url_for('my_route', array('variable1'=>'news', 'variable2'=>'sports', 'variable3'=>'page2'));?>

So it should produce:

/news/sports/page2.html