0

I got a little problem here. I'm currently trying to use the Zend Router Rewrite but I got this error:

Fatal error: Uncaught exception 'Zend_Controller_Router_Exception' with message 'alias is not specified'

Here's my code for the route:

// BLOG -> CATEGORIES -> LIST ARTICLES
$route = new Zend_Controller_Router_Route(
    '/blog/categories/:alias',
    array(
        'module'     => 'blog',
        'controller' => 'categories',
        'action'     => 'list'
    )
);
$router->addRoute('blog-categories-list', $route);

The URL i'm trying to access is: /blog/categories/general/.

Why am I getting this error?

P.S.: I didn't specify a default value for :alias 'cause I have this route also:

// BLOG -> CATEGORIES
$route = new Zend_Controller_Router_Route(
    'blog/categories/',
    array(
        'module'     => 'blog',
        'controller' => 'categories',
        'action'     => 'index'
    )
);
$router->addRoute('blog-categories', $route);
Frederick Marcoux
  • 2,195
  • 1
  • 26
  • 57

1 Answers1

1

This error is probably coming from somewhere where you are trying to output a link using the route, such as the URL helper:

$this->url(array(), 'blog-categories-list')

It's telling you that you need to pass 'alias' to this as well.

Tim Fountain
  • 33,093
  • 5
  • 41
  • 69