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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-17-2008, 09:06 AM
Junior Member
 
Join Date: Jan 2008
Posts: 1
Default Stuck with routing

Hi!

I've been trying for ever to figure out the routing rules. Basically I wan't all requests routed to one controller (see no.1), except from the ones where the path starts with "admin" (see no. 2 & 3)

My directory structure:
  1. application/Frontend/controllers/IndexController.php
  2. application/Admin/module1/controllers
  3. application/Admin/module2/controllers
etc.

Any advice how to go about this is greatly appreciated!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-24-2008, 02:37 PM
Junior Member
 
Join Date: May 2007
Posts: 25
Default

i do the same thing with a controller plugin:

Quote:
class DSF_Controller_Plugin_SetPagePath extends Zend_Controller_Plugin_Abstract
{
/**
* this function routes all requests that come in to the default module to the index controller / index action
*
* @param zend_controller_request $request
*/
public function preDispatch($request)
{
if($request->module == 'public')
{
$request->setControllerName('index');
$request->setActionName('index');
}

}
}
then to use it (in bootstrap):

Quote:
// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->registerPlugin(new DSF_Controller_Plugin_SetPagePath());
If you want to see exactly how this works you can download the source from google code.

Last edited by frosty1 : 01-24-2008 at 02:41 PM. Reason: more details
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:01 AM.