Hi everybody, 

I'm trying to create an "alias" for a controller in a Zend application, and
I'm not sure which is the best way to do it.

I got a "categories" controller to manage categories in the app and I would
like to replicate it ("families", for example) but don't want to copy and
paste all its files. "categories" and "families" would be very similar, the
only difference between them may be the db table they use.

How do you think it could be done? Through routing? Rewriting the dispatch
method (Zend_Controller_Front or Zend_Controller_Dispatcher_Standard)? Any
idea? Thanks in advance!!

I tried it creating a new route (I was using the standard one) like this:

$router->addRoute(
    'families',
    new Zend_Controller_Router_Route('families/:action/*', 
    array('module' => 'default', 'controller' => 'categories', 'action' =>
'index'))
);

And it worked BUT now it generates URIs like:

/families/edit/controller/categories/id/4

I can't understand why it's including 'controller' parameter. Can anyone
help me, please?
-- 
View this message in context: 
http://www.nabble.com/Alias-for-controller-tp15222055s16154p15222055.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to