1

Hi I created several module for my own CMS like category, article, core , ...
now how can I access these modules with url like:

http://localhost/mycms/admin/category
http://localhost/mycms/admin/article , ...

note: the admin is not module, it's only prefix

1 Answer 1

2

In "application/Bootstrap.php":

public function _initRoute(){    

$frontController = Zend_Controller_Front::getInstance();

            $router = $frontController->getRouter(); // returns a rewrite router by default
            $router->addRoute(
                'category',
                new Zend_Controller_Router_Route('admin/category/:controller/:action',
                                                 array('module' => 'category',
                                                        'controller' => 'index',
                                                       'action' => 'index'))
            );
}

Then type in URL : ex : http://localhost/mycms/admin/category and you get there.

Same with others.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.