Created
April 22, 2014 18:12
-
-
Save dawehner/11188956 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ResourceRoutes extends RouteSubscriberBase{ | |
protected function alterRoutes(RouteCollection $collection) { | |
$routes = array(); | |
$enabled_resources = $this->config->get('rest.settings')->get('resources') ?: array(); | |
// Iterate over all enabled resource plugins. | |
foreach ($enabled_resources as $id => $enabled_methods) { | |
$plugin = $this->manager->getInstance(array('id' => $id)); | |
foreach ($plugin->routes() as $name => $route) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment