/** * Do create the REST routes * @return array The route objects */ protected function doCreateRoutes() { $providerRoutes = ezpRestProvider::getProvider( ezpRestPrefixFilterInterface::getApiProviderName() )->getRoutes(); $providerRoutes['fatal'] = new ezpMvcRailsRoute( '/fatal', 'ezpRestErrorController', 'show' ); return ezcMvcRouter::prefix( eZINI::instance( 'rest.ini' )->variable( 'System', 'ApiPrefix' ), $providerRoutes ); }
/** * Do create the REST routes * @return array The route objects */ protected function doCreateRoutes() { $providerRoutes = ezpRestProvider::getProvider( ezpRestPrefixFilterInterface::getApiProviderName() )->getRoutes(); $routes = array( 'fatal' => new ezpMvcRailsRoute( '/fatal', 'ezpRestErrorController', 'show' ), ); $prefix = eZINI::instance( 'rest.ini' )->variable( 'System', 'ApiPrefix' ); $prefixedRoutes = ezcMvcRouter::prefix( $prefix, array_merge( $providerRoutes, $routes ) ); return $prefixedRoutes; }
public function createRoutes() { $routes[] = new ezcMvcRegexpRouteStruct('@^/styles/(?P<slug>.+)/$@', 'yourStyleController', array('defaultValue1' => 42)); // Add routes from an application $appRouterOne = new myApplicationDecoupledRouterOne(); $routes += $appRouterOne->createRoutes(); // Add routes from an application, prefixed with the blog/ prefix. $appRouter = new myApplicationDecoupledRouterDefault(); $routes += ezcMvcRouter::prefix('blog/', $appRouter->createRoutes()); return $routes; }
public function createRoutes() { $providerRoutes = ezpRestProvider::getProvider(ezpRestPrefixFilterInterface::getApiProviderName())->getRoutes(); $routes = array(new ezcMvcRailsRoute('/fatal', 'ezpRestErrorController', 'show'), new ezcMvcRailsRoute('/http-basic-auth', 'ezpRestAuthController', 'basicAuth'), new ezcMvcRailsRoute('/login/oauth', 'ezpRestAuthController', 'oauthRequired'), new ezcMvcRailsRoute('/oauth/token', 'ezpRestOauthTokenController', 'handleRequest'), new ezpRestVersionedRoute(new ezcMvcRailsRoute('/foo', 'myController', 'myActionOne'), 1), new ezpRestVersionedRoute(new ezcMvcRailsRoute('/foo', 'myController', 'myActionOneBetter'), 2)); return ezcMvcRouter::prefix('/api', array_merge($providerRoutes, $routes)); }