2 namespace Application\View\Helper;
4 use Zend\View\Helper\AbstractHelper,
5 Zend\Mvc\Router\RouteStack;
7 class Url extends AbstractHelper
11 public function setRouter(RouteStack $router)
13 $this->router = $router;
16 public function direct($params = array(), $options = array())
18 if (null === $this->router) {
22 // Remove trailing '/index' from generated URLs.
23 $url = $this->router->assemble($params, $options);
24 if ((6 <= strlen($url)) && '/index' == substr($url, -6)) {
25 $url = substr($url, 0, strlen($url) - 6);