public function createView( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result ) { $viewController = ezpRestProvider::getProvider( ezpRestPrefixFilterInterface::getApiProviderName() )->getViewController(); $view = $viewController->loadView( $routeInfo, $request, $result ); return $view; }
/** * 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() { $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)); }