ZF-222: Zend_Controller_RewriteRouter error

Description

when I point my browser to http://localhost/archive/1/ everything is OK and new rewriteRouter works OK.

But, if I add two more para in URL I receive error message (http://localhost/archive/1/2/3)

code in index.php:

$router = new Zend_Controller_RewriteRouter(); $router->addRoute('default', '', array('controller' => 'search', 'action' => 'cars'));

$controller = Zend_Controller_Front::getInstance();

$controller->setRouter($router);

Error message: Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in D:\radni\new\library\Zend\Controller\Action.php on line 143

Comments

It's strange, Tautvydas. Whith routes configured like that and url of http://localhost/archive/1/ you should get an error similar to that one:

Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING in /path...

You simply can't have a method named 1Action.

Which version of the router are you using? Is it 0.1.5 version that moved to library yesterday or some custom router modified by you or someone else? Or do you have more routes defined and showed only this one?

I'm terribly sorry, Nikola. I have copied and used a wrong name in the above comment :)

Sorry for wrong example.

I find where the problem was.

this is router:

$router->addRoute('default', '', array('controller' => 'index', 'action' => 'index'));

and this is URL:

http://localhost/archive/nikola/dfssd/fsdaf/

I was receiving warning coz I was trying to get param in IndexController.php:

public function noRouteAction() { echo $this->_getParam("nikola"); } P.S. I have just this one router from the Zend library

Maybe, my addRouter definition is wrong?

With a current router and url like the one above you will get to ArchiveController and nikolaAction of that controller. There you can get the rest of params:

$res = $this->_getParam("dfssd");

$res will now have a value of 'fsdaf'.

Thanks Michael