I've put in a bunch of debug code and this is what I've got.

Zend_Rest_Route
Zend_Controller_Router_Route_Hostname
Calling chain... 
hostname match();
Hostname $host: Array ( [0] => api [1] => blitz [2] => com ) 
Hostname returns: Array ( ) 
rest match();
Rest Path: Array ( [0] => events ) 
Rest values: Array ( [controller] => events [action] => index ) 
Rest defaults: Array ( [module] => api [controller] => index [action] =>
index ) 
Rest returns: Array ( [controller] => events [action] => index [module] =>
api ) 

for this code:

$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
                
// API
$apiRestRoute = new Zend_Rest_Route($front, array('module' => 'api'));
$apiHostRoute = new Zend_Controller_Router_Route_Hostname('api.blitz.com');
                
$router->addRoute('api', $apiHostRoute->chain($apiRestRoute));

The chained rest route is returning what appears to be the correct data yet
I receive this error.

Exception Information:

Error Message: Invalid controller specified (events)

Stack Trace:

#0
C:\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Front.php(946):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http))
#1
C:\Zend\ZendServer\share\ZendFramework\library\Zend\Application\Bootstrap\Bootstrap.php(77):
Zend_Controller_Front->dispatch()
#2 C:\Zend\ZendServer\share\ZendFramework\library\Zend\Application.php(358):
Zend_Application_Bootstrap_Bootstrap->run()
#3 G:\Documents\Workspace\Blitzaroo\public\index.php(28):
Zend_Application->run()
#4 {main}       
Request Parameters:

array (
  'controller' => 'events',
  'action' => 'index',
  'module' => 'default',
)

So, why is it still trying to use the default module even though the
Rest_Route is returning the proper data?
-- 
View this message in context: 
http://old.nabble.com/Zend_Rest_Route-%2B-Chaining-tp26348056p26354296.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to