In the routing requirements you can specify a regular expression for the
pattern:
job_show_user:
url: /job/:company/:location/:id/:position
param: { module: job, action: show }
requirements:
id: \d+
From:
http://www.symfony-project.org/jobeet/1_2/Doctrine/en/05#chapter_05_requirem
ents
For your specific case it would be something like:
id: \w+$
If you're rusty with regular expressions then google is your friend or this
is a good intro: http://xreplace.vestris.com/docs/regexp-tutorial.html
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of HiDDeN
Sent: 09 May 2009 19:03
To: symfony users
Subject: [symfony-users] Forcing routing to be only characters and numbers
I'd like to define a route as characters and numbers only.
I mean something like this:
/section-this-is-the-title-123.htm
How would I do this? I know I can define a '.*' requirement, but if I
do that, it will be incompatible with some other route beginning with
"section-".
So, how? I tried almost everyting related to ranges, but it doesn't
work:
requirements: { slugZona: '(0-9a-z)*' }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---