Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2008, 02:42 PM
Junior Member
 
Join Date: Jul 2008
Posts: 1
Post Module/Controller/Action Routing Problem

I have a website that requires (if possible) a URL system as such

tag/category/sub-category/product
tag/category/product
tag/product

I've been reading up on Zend_Controller_Router and I can't seem to think of a possible solution. Am I missing something, is this possible, and if so can anyone give me some pointers?

Last edited by nite-rain : 07-02-2008 at 09:03 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-04-2008, 11:17 PM
Junior Member
 
Join Date: Oct 2007
Posts: 27
Default

PHP Code:
$router Zend_Controller_Front::getInstance()->getRouter(); 

//tag/product
$router->addRoute(
    
'product',
    new 
Zend_Controller_Router_Route('tag/:product', array('controller' => 'products''action' => 'index'))
);

tag/category/product
$router
->addRoute(
    
'category-product',
    new 
Zend_Controller_Router_Route('tag/:category/:product', array('controller' => 'products''action' => 'index'))
);

//tag/category/sub-category/product
$router->addRoute(
    
'subcategory-category-product',
    new 
Zend_Controller_Router_Route('tag/:category/:sub-category/:product', array('controller' => 'products''action' => 'index'))
); 
These rules should work, provided that you dont have any forward slashes in your product or category names.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:49 PM.