I am trying to define RESTful routes for subdirectory controllers. I want to be able to create routes for the url in admin/questions/* . My controller: Admin_QuestionsController:
- application - controllers -Admin QuestionsController.php (class Admin_QuestionsController)
The following shows how I declare my RESTful route for this controller:
$restRoute = new Zend_Rest_Route($front, array(), array( 'admin' => array('questions') )); $router->addRoute('rest', $restRoute);
.. from the documentation I do not see what I'm doing wrong - http://framework.zend.com/manual/1.12/en/zend.controller.router.html#zend.controller.router.routes.rest . However, I get the following error:
Invalid controller specified (admin)
I can make routes work when I declare then not as recreation routes:
$router->addRoute('admin_questions', new Zend_Controller_Router_Route( '/admin/questions', array( 'controller' => 'Admin_Questions', 'action' => 'index') ) );
..so I donβt think I have the wrong folder structure or class name. But I need RESTful routes that I cannot reach.
php zend-framework
Martyn
source share