This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.0 » Routing issue for /:make/:model/
Routing issue for /:make/:model/ [message #102285] Sat, 10 July 2010 09:34 Go to next message
tejasparmarc  is currently offline tejasparmarc
Messages: 6
Registered: July 2010
Junior Member
i wrote a rules in routing.yml like

qsearch:
url: /:make/:model/
param: { module: car, action: list }

Because i want a url like URL/make/model

--make and model will come dynamic
--For example URL/audi/a4

but above rules breaks another url

For e.g if i call URL/car_ad/postImage it redirect to car/list


if i write ,

qsearch:
url: /:make/:model/*
param: { module: car, action: list }
requirements: { make: ^(audi|bmw) }

it works.. but for that each make entry i have to add in routing
file..

Thanks in Advance.
Tejasparmar



Re: Routing issue for /:make/:model/ [message #102307 is a reply to message #102285 ] Sat, 10 July 2010 23:09 Go to previous messageGo to next message
septem  is currently offline septem
Messages: 19
Registered: January 2009
Location: Riga, Latvia
Junior Member
Make a route for this link /car_ad/postImage if you don't have it already. Then put it before qsearch route. The order of the routes is important, first matched route is used.

[Updated on: Sat, 10 July 2010 23:11]


Ivo Az.
Re: Routing issue for /:make/:model/ [message #102333 is a reply to message #102285 ] Mon, 12 July 2010 05:56 Go to previous messageGo to next message
tejasparmarc  is currently offline tejasparmarc
Messages: 6
Registered: July 2010
Junior Member
hi septem Thanks for reply

septem i know if i can define car_ad/postImage above that rules
it will work but car_ad/postImage is not a single rule... there are lots of rules in the whole project. so How can i define all rules in routing.yml.

Regards,
Tejas parmar
Re: Routing issue for /:make/:model/ [message #102342 is a reply to message #102285 ] Mon, 12 July 2010 08:43 Go to previous message
tejasparmarc  is currently offline tejasparmarc
Messages: 6
Registered: July 2010
Junior Member
Hi

i tried this and working well

qsearch:
url: /:name
param: { module: brand, action: index }
requirements: { name: ^(?!users|account|main|search|story)[a-z,A-Z,0-9,_,-]+$ }


And users,story,account will be your project's module

You have to define whole project's modules there.

It will work ..i tried in symfony 1.0


Regards,
Tejas Parmar
Previous Topic:Session does not work
Next Topic:is it ok to increase max_forwards ?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software