Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


Zend_Rest_Route not working for a sub-directory controller


I'm trying to define RESTful routes for sub directory controllers. I want to be able to create routes for the url at admin/questions/*. My controller is Admin_QuestionsController:

- application
  - controllers
    -Admin
      QuestionsController.php (class Admin_QuestionsController)

Below is how I'm declaring 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 can't 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 get the routes to work when I declare then not as Rest routes:

$router->addRoute('admin_questions',
    new Zend_Controller_Router_Route( '/admin/questions', array(
        'controller' => 'Admin_Questions', 
        'action' => 'index')
    )
);

..so I don't think I've have the folder structure wrong, or the class name. But, I need RESTful routes which I'm unable to achieve.


asked May 16, 2015 in Zend by rajesh
0 votes
12 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...