Using Zend_Rest_Route with Zend_Navigation

I want to start using Zend_Rest_Controller for my application and have configured routing like this in my bootstrap:

protected function _initRestfulRoutes()
{
    $front = Zend_Controller_Front::getInstance();
    $router = $front->getRouter();

    // Specifying all controllers as RESTful:
    $restRoute = new Zend_Rest_Route($front);
    $router->addRoute('default', $restRoute);
}

      

However, when using Zend_Navigation, all routes will be indexed by default. My routes are defined like this:

    <users>
        <label>Users</label>
        <controller>users</controller>
        <action>index</action>
        <route>default</route>
        <pages>
            <delete>
                <label>Delete Me</label>
                <controller>users</controller>
                <action>delete</action>
                <id>1</id>
                <route>default</route>
            </delete>
        </pages>
    </users>

      

The delete path is resolved as http://myapp.com/users

instead ofhttp://myapp.com/users/1?_method=DELETE

Any idea what's going on? Thanks.

+2


a source to share


1 answer


Zend_Rest_Route will not redirect to "deleteAction ()" based on a GET request. To call "deleteAction" you need to send a POST request with _method = DELETE in the body of the request.



+2


a source







All Articles