views:

327

answers:

1

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?

+4  A: 

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
Darmen
Well, I think I was unclear in my question. The literal was 'page', and variable3 is the page number.But I solved it from a different point of view. I used the entire "page2" as a variable, as you suggested, and then in the controller I separated "page" from "2".Thanks anyway.
David