Hi,
what you want is not possible with symfony, there must be separator
between literal and variable. If you don't like slash there you can
use other character, just set it in config/factories.yml:
all:
routing:
class: sfPatternRouting
param:
generate_shortest_url: true
extra_parameters_as_query_string: true
segment_separators: [/,-]
the above would add dash as separator, so you can use
url: /:variable1/:variable2/literal-:variable3.html
-- Marek
PS: If it was possible to set segment_separators_regexp, you would be
set. However this isn't available
On 6. Feb, 11:39 h., HiDDeN <[email protected]> wrote:
> 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
>
> How could I solve this?
>
> On 6 feb, 00:05, HiDDeN <[email protected]> wrote:
>
> > Adrianrz, look again my question please. The problem I have is in
> > "literal:variable3".
>
> > On Feb 5, 7:20 pm, adrianrz <[email protected]> wrote:
>
> > > Hi,
>
> > > the .html must be defined on setting.yml as suffix and then the route
> > > would be
>
> > > my_route:
> > > url: /:variable1/:variable2/literal/:variable3
>
> > > and the url
> > > showhttp://www.yoursite.com/variable1/variable2/literal/variable3.html
> > > but i hope that this variables are not so variable otherwise google
> > > will not index well these urls
>
> > > Regards
>
> > > Adrián
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.