hi All,

I seem to be running into a PEBKAC issue with Zend_Rest_Route

I've initialized the rest route with the following (See
http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.basic
)

$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
// Rest enabled module only
$restRoute = new Zend_Rest_Route($front, array(), array('articles'));
$router->addRoute('rest', $restRoute);


Now I want to be able to have URLS such as

http://foo.com/articles/1/json

(For the json, I'm using context switch helper)

So, I've added the following route;

$route = new Zend_Controller_Router_Route('articles/:articleid',
array('module' => 'articles', 'controller' => 'index', 'format' => ''));
$router->addRoute('articleRoute', $route);

However when I request via curl I keep getting Invalid controller; And my
request appears to have been directed to the index action no matter if i do
a DELETE

array (
  'module' => 'articles',

  'controller' => '1234',
  'action' => 'index',
  'format' => 'xml',
)

I'm obvisouly missing out something here so if anyone could be so kind and
advise me of my errors would be most helpful. Think I managed to get myself
into a rut here and can't see the wood for the trees.

TIA
AJ

Reply via email to