public function register(\CentralApps\Base\Application $application)
 {
     $key = $this->key;
     $container = $application->getContainer();
     $container[$this->key] = $container->share(function ($c) use($key, $application) {
         // routing settings
         $routing_settings = $c->getSettingFromNestedKey($nested_key = array($key));
         $cache = isset($routing_settings['cache']) ? $routing_settings['cache'] : null;
         $locator = new \Symfony\Component\Config\FileLocator(array($application->getApplicationRootFolder()));
         $loader = new \Symfony\Component\Routing\Loader\YamlFileLoader($locator);
         $loader->load('routes.yml');
         $request = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
         $request_method = isset($_POST) && isset($_POST['_method']) ? $_POST['_method'] : (isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '');
         $request_context = new \Symfony\Component\Routing\RequestContext($request, $request_method, isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '');
         $router = new \Symfony\Component\Routing\Router(new \Symfony\Component\Routing\Loader\YamlFileLoader($locator), 'routes.yml', array('cache_dir' => $cache), $request_context);
         return $router;
     });
     $container[$this->key . '.url_generator'] = $container->share(function ($container) use($key) {
         return new \Symfony\Component\Routing\Generator\UrlGenerator($container[$key]->getRouteCollection(), new \Symfony\Component\Routing\RequestContext('', isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ''));
     });
     $this->registerRouteFunction($application);
 }