// subcategory routing
Router::connect(
'/:catslug/:subcatslug/*',
array('controller' => 'sub_categories', 'action' => 'view'),
array(
'pass' => array('catslug','subcatslug')
)
);
// product routing
Router::connect(
'/:catslug/:subcatslug/:prodslug',
array('controller' => 'products', 'action' => 'view'),
array(
'pass' => array('catslug','subcatslug','prodslug')
)
);
I want to do something like this. I know the code above is wrong, but I need
help to correct it. This is what I need to do:
domain.com/category/subcategory - this is subcategory page and it has
sorting/pagination feature. so the url could be
domain.com/category/subcategory/*
and for product page domain.com/category/subcategory/product - i want to use
product controller. But according to my (wrong) code it is pointing to
subcategory controller.
Please let me know the proper way to do this.
Thanks
Adnan
visskiss wrote:
>
>
> Good day to you all,
>
> I have tried to solve this and it's killing me.
>
> My site is working well, but I am trying to perfect the URL's to
> optimize for search.
>
> The short question:
>
> Doe anybody know how to get the routes regex working so that all
> queries EXCEPT those in a given list (say, all queries except those
> starting with certain keywords (Like Registration, Users, Pages) get
> forwarded to a specific controller and action?
>
> I have tried everything I can muster.
>
>
> Regards,
> Danny
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>
>
--
View this message in context: http://old.nabble.com/Routes-Regex-problem-tp23077336p27343229.html
Sent from the CakePHP mailing list archive at Nabble.com.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment