Zend Framework Multi Module Access?
I have two modules in my application Admin and Default (Shopping Cart).
In My Admin Module I have added 3 Controllers Products, Category and Users
I want to add 3 Links in My Layout but it will cause error
Links to be added as:
<a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'index'), 'admin', true); ?>">Products</a>开发者_Go百科;
When I Click on This Link It will show me error
Message: Route admin is not defined
Give Answer with Example
Thanks
The second parameter to the url view helper is for the router name. If you haven't defined a custom router, then you don't use it. What you need to do, is put 'module' in the array for the first parameter, like this:
<?php echo $this->url(array('module'=>'admin','controller'=>'index', 'action'=>'index')); ?>
精彩评论