SAAS-1063: REST API for podcasts
Hierarchy routing is working Basic implentation of podcast INDEX and POST actions done
This commit is contained in:
parent
a444751397
commit
67db2c1d25
9 changed files with 391 additions and 9 deletions
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once 'RouteController.php';
|
||||
|
||||
class Rest_Bootstrap extends Zend_Application_Module_Bootstrap
|
||||
{
|
||||
protected function _initRouter()
|
||||
|
@ -8,9 +10,35 @@ class Rest_Bootstrap extends Zend_Application_Module_Bootstrap
|
|||
$router = $front->getRouter();
|
||||
|
||||
$restRoute = new Zend_Rest_Route($front, array(), array(
|
||||
'rest'=> array('media', 'show-image')));
|
||||
'rest'=> array('media', 'show-image', 'podcast', 'podcast-episodes')));
|
||||
assert($router->addRoute('rest', $restRoute));
|
||||
|
||||
$route = new Rest_RouteController($front,
|
||||
'rest/podcast/:id/episodes',
|
||||
array(
|
||||
'controller' => 'podcast-episodes',
|
||||
'module' => 'rest'
|
||||
),
|
||||
array(
|
||||
'id' => '\d+'
|
||||
)
|
||||
);
|
||||
$router->addRoute('podcast-episodes-index', $route);
|
||||
|
||||
$route = new Rest_RouteController($front,
|
||||
'rest/podcast/:id/episodes/:episode_id',
|
||||
array(
|
||||
'controller' => 'podcast-episodes',
|
||||
'module' => 'rest'
|
||||
),
|
||||
array(
|
||||
'id' => '\d+',
|
||||
'episode_id' => '\d+'
|
||||
)
|
||||
);
|
||||
$router->addRoute('podcast-episodes', $route);
|
||||
|
||||
|
||||
/** MediaController Routes **/
|
||||
$downloadRoute = new Zend_Controller_Router_Route(
|
||||
'rest/media/:id/download',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue