0
$router->addRoute('routeName', new Zend_Controller_Router_Route( 'test/:category/', array( 'module' => 'default', 'controller' => 'test', 'action' => ':category' ) )); 

That's my code at the moment (see above). How could I call now the action by a given param (via URL)? The url look e.g. like that: domain.com/test/news/ and now I want to call the action newsAction() in the test controller. With the code above I get the error: Action "category" does not exist and was not trapped in __call()

2 Answers 2

3

Your statement is useless. The goal you want to achieve is exactly how the standard route works.

Sign up to request clarification or add additional context in comments.

Comments

1

You should be able to simply use :action in your route. Alternatively, you could use a custom __call() method in your controller to catch dynamic action names.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.