Hello all,

I have a subcontroller in my cms module named content_page,
and i have to access the subcontroller with the following url:
http://cms.mydomain.nl/content_page.
But what i want is to access the subcontroller like this:
http://cms.mydomain.nl/content/page because 
i don't like the '_' in the url. I know that i have to create a custom route
for it to achieve that but for some reason it doesn't work for me, here's my
custom route that i have setup in a controller plugin:

My custom route Plugin
[code]
<?php

class APP_Controller_Plugin_Routes extends Zend_Controller_Plugin_Abstract
{
        protected $_domain = 'mydomain.nl';
        
        public function routeStartup(Zend_Controller_Request_Abstract $request)
        {
                $front = Zend_Controller_Front::getInstance();
                $router = $front->getRouter();
                $router->removeDefaultRoutes();
                
                $pathRoute = new Zend_Controller_Router_Route(
                        ':controller/:action/*',
                        array(
                                'controller' => 'content_page',
                                'action'         => 'index'
                        )
                );
                
                $defaultRoute = new Zend_Controller_Router_Route(
                        'cms.'.$this->_domain.'/content/page',
                        array(
                                'module'         => 'cms'
                        )
                );
                
                $router->addRoute('cms', $defaultRoute->chain($pathRoute));
        }
}
[/code]

--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/subcontroller-path-separator-tp3446708p3446708.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to