ZF-222: Zend_Controller_RewriteRouter error

Issue Type: Bug Created: 2006-07-10T16:28:12.000+0000 Last Updated: 2007-07-05T14:43:13.000+0000 Status: Resolved Fix version(s): Reporter: Nikola Mitic (nikolam) Assignee: Michal Minicki (martel) Tags: - Zend_Controller

Related issues: Attachments:


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();


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


Posted by Michal Minicki (martel) on 2006-07-11T03:30:49.000+0000

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?

Posted by Michal Minicki (martel) on 2006-07-11T03:33:05.000+0000

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

Posted by Nikola Mitic (nikolam) on 2006-07-11T12:08:56.000+0000

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:


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?

Posted by Michal Minicki (martel) on 2006-07-12T05:32:58.000+0000

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'.

Posted by Nikola Mitic (nikolam) on 2006-07-12T12:10:44.000+0000

Thanks Michael

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.