Hi 

I never mentioned the default values in my rules... and it works fine for
me...
May be its different in different versions....

But i am not sure..

Regards
Kusum



umpirsky wrote:
> 
> Can you please explain on this example
> 
> resources.router.routes.articlename.type = "Zend_Controller_Router_Route"
> resources.router.routes.articlename.route = ":categoryname/:articlename"
> resources.router.routes.articlename.defaults.controller = "article"
> resources.router.routes.articlename.defaults.action = "index"
> resources.router.routes.articlename.reqs.qqq = "[a-z0-9-]+"
> (works, takes me to article page)
> 
> What is qqq? And, if route is ":categoryname/:articlename", in my app if I
> don't put default value for each :param in the route, I get exception -
> says
> param is required.
> 
> My example:
> 
> resources.router.routes.car.route = "/oglas/:title/:id"
> resources.router.routes.car.defaults.module = "default"
> resources.router.routes.car.defaults.controller = "search"
> resources.router.routes.car.defaults.action = "view"
> resources.router.routes.car.defaults.title = ""
> resources.router.routes.car.defaults.id = "0"
> 
> wont work without last 2 lines.
> 
> Regards,
> Saša Stamenković
> 
> 
> On Fri, Dec 18, 2009 at 4:03 AM, Mon Zafra <[email protected]> wrote:
> 
>> A few things:
>>
>> * Make sure your route names are unique. I see two each of the 'articles'
>> and 'articlenew' routes.
>> * Remember that the last route defined will be the tried first, so put
>> the
>> more specific routes after the more generic ones.
>> * The keys of the reqs array should match a parameter name, otherwise
>> they're useless.
>>
>>    -- Mon
>>
>>
>>
>> On Fri, Dec 18, 2009 at 5:59 AM, kusum <[email protected]> wrote:
>>
>>>
>>> Hi
>>> i have made various rules for paths...
>>> All of them work individually but when i place them together some don't
>>> work.
>>> if i change their order some other stops to work.
>>>
>>> My application.ini file has rules in this order:-
>>>
>>> resources.router.routes.categoryname.type =
>>> "Zend_Controller_Router_Route"
>>> resources.router.routes.categoryname.route = ":categoryname"
>>> resources.router.routes.categoryname.defaults.controller = "category"
>>> resources.router.routes.categoryname.defaults.action = "index"
>>> resources.router.routes.categoryname.reqs.categoryname = "[a-z0-9-]+"
>>> (works, takes me to category page)
>>>
>>> resources.router.routes.articlename.type =
>>> "Zend_Controller_Router_Route"
>>> resources.router.routes.articlename.route = ":categoryname/:articlename"
>>> resources.router.routes.articlename.defaults.controller = "article"
>>> resources.router.routes.articlename.defaults.action = "index"
>>> resources.router.routes.articlename.reqs.qqq = "[a-z0-9-]+"
>>> (works, takes me to article page)
>>>
>>> resources.router.routes.user.type = "Zend_Controller_Router_Route"
>>> resources.router.routes.user.route = "user"
>>> resources.router.routes.user.defaults.controller = "user"
>>> resources.router.routes.user.defaults.action = "index"
>>> resources.router.routes.user.reqs.username = "[a-z0-9-]+"
>>> (works, takes me to user page)
>>>
>>> resources.router.routes.articlenew.type = "Zend_Controller_Router_Route"
>>> resources.router.routes.articlenew.route = ":categoryname/new"
>>> resources.router.routes.articlenew.defaults.controller = "category"
>>> resources.router.routes.articlenew.defaults.action = "new"
>>> resources.router.routes.articlenew.reqs.username = "[a-z0-9-]+"
>>> (works, but takes me to wrong page that is article page instead of new
>>> category page)
>>>
>>> resources.router.routes.articlenew.type = "Zend_Controller_Router_Route"
>>> resources.router.routes.articlenew.route = ":categor/:articl/edit"
>>> resources.router.routes.articlenew.defaults.controller = "article"
>>> resources.router.routes.articlenew.defaults.action = "edit"
>>> resources.router.routes.articlenew.reqs.username = "[a-z0-9-]+"
>>> (works, takes me to edit page)
>>>
>>> resources.router.routes.articles.type = "Zend_Controller_Router_Route"
>>> resources.router.routes.articles.route = "user/activate/:userId/:accode"
>>> resources.router.routes.articles.defaults.controller = "user"
>>> resources.router.routes.articles.defaults.action = "activate"
>>> resources.router.routes.articles.reqs.username = "[a-z0-9-]+"
>>> (works, takes me to user page but takes wrong values)
>>> Array ( [controller] => user [action] => activate [45] =>
>>> 6ed38d3abc73818209ef10251e45ca32ba95f09c [module] => default )
>>> it should be
>>> Array ( [controller] => user [action] => activate [userId] => 45
>>> [accode]
>>> =>
>>> 6ed38d3abc73818209ef10251e45ca32ba95f09c [module] => default )
>>>
>>> resources.router.routes.articles.type = "Zend_Controller_Router_Route"
>>> resources.router.routes.articles.route = "user/:act"
>>> resources.router.routes.articles.defaults.controller = "user"
>>> resources.router.routes.articles.defaults.action = "index"
>>> resources.router.routes.articles.reqs.qqq = "[a-z0-9-]+"
>>> (works, takes me to user page)
>>>
>>>
>>> Now if i move not working one down it starts working but some other
>>> stops
>>> working....
>>>
>>> Is there any specific sequence to order rules...
>>>
>>> PLease help.....
>>>
>>> Regards
>>> Kusum
>>> --
>>> View this message in context:
>>> http://n4.nabble.com/Route-Rewrite-Problem-tp974415p974415.html
>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>>
>>
>>
> 
> 

-- 
View this message in context: 
http://n4.nabble.com/Route-Rewrite-Problem-tp974415p976406.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to