protected function configureRoutes(RouteCollectionBuilder $routes) { if (in_array($this->getEnvironment(), array('dev', 'test'), true)) { $routes->mount('/_wdt', $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml')); $routes->mount('/_profiler', $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')); } $routes->mount('/', $routes->import('@AppBundle/Controller', 'annotation')); }
protected function configureRoutes(RouteCollectionBuilder $routes) { if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { $routes->mount('/', $routes->import('@CoreSphereConsoleBundle/Resources/config/routing.yml')); } $routes->mount('/', $routes->import('@FOSUserBundle/Resources/config/routing/all.xml')); $routes->mount('/', $routes->import('@AppBundle/Controller', 'annotation')); }
/** * {@inheritdoc} */ protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->add('/', 'PandawanAcademyRegistrationBundle:Registration:index', 'homepage'); if (isset($this->bundles['WebProfilerBundle'])) { $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt'); $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler'); } }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->import('@AppBundle', '/', 'annotation'); // if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt'); $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler'); // } }
protected function configureRoutes(RouteCollectionBuilder $routes) { if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { $routes->mount('/_wdt', $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml')); $routes->mount('/_profiler', $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')); } $routes->mount('/', $routes->import(__DIR__ . '/config/routing.yml')); }
protected function configureRoutes(RouteCollectionBuilder $routes) { if (in_array($this->getEnvironment(), ['dev'], true)) { $routes->import($this->getRootDir() . '/config/routing_' . $this->getEnvironment() . '.yml'); } else { $routes->import($this->getRootDir() . '/config/routing.yml'); } }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->import('@MuseBundle/Resources/routing/routing.xml'); if ($this->debug) { $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt'); $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler'); } }
public function configureRoutes(RouteCollectionBuilder $routes) { $routes->import(__DIR__ . '/config/routing.yml'); // import the WebProfilerRoutes, only if the bundle is enabled if (isset($this->bundles['WebProfilerBundle'])) { $routes->mount('/_wdt', $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml')); $routes->mount('/_profiler', $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')); } }
protected function configureRoutes(RouteCollectionBuilder $routes) { // import the WebProfilerRoutes, only if the bundle is enabled if (isset($this->bundles['WebProfilerBundle'])) { $routes->mount('/_wdt', $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml')); $routes->mount('/_profiler', $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')); } // load the annotation routes $routes->mount('/', $routes->import(__DIR__ . '/../src/AppBundle/Controllers/', 'annotation')); }
protected function configureRoutes(RouteCollectionBuilder $routes) { // import the WebProfilerRoutes, only if the bundle is enabled if (isset($this->bundles['WebProfilerBundle'])) { $routes->mount('/_wdt', $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml')); $routes->mount('/_profiler', $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')); } // load the routes $routes->mount('/', $routes->import('@KmeliaFreshBundle/Resources/config/routing.yml')); }
/** * {@inheritdoc} */ protected function configureRoutes(RouteCollectionBuilder $routes) { // Specify explicitly the controller $routes->add('/', 'Dunglas\\ActionBundle\\Tests\\Fixtures\\TestBundle\\Action\\DummyAction', 'dummy'); $routes->add('/isolated', 'Dunglas\\ActionBundle\\Tests\\Fixtures\\IsolatedAction\\AnIsolatedAction', 'isolated'); // Use the @Route annotation $routes->import('@TestBundle/Action/', '/', 'annotation'); // Cohabitation between old school controllers and actions $routes->import('@TestBundle/Controller/', '/', 'annotation'); $routes->import('@NotScannedBundle/Controller/', '/', 'annotation'); }
public function testFlushOrdering() { $importedCollection = new RouteCollection(); $importedCollection->add('imported_route1', new Route('/imported/foo1')); $importedCollection->add('imported_route2', new Route('/imported/foo2')); $loader = $this->getMock('Symfony\\Component\\Config\\Loader\\LoaderInterface'); // make this loader able to do the import - keeps mocking simple $loader->expects($this->any())->method('supports')->will($this->returnValue(true)); $loader->expects($this->once())->method('load')->will($this->returnValue($importedCollection)); $routes = new RouteCollectionBuilder($loader); // 1) Add a route $routes->add('/checkout', 'AppBundle:Order:checkout', 'checkout_route'); // 2) Import from a file $routes->mount('/', $routes->import('admin_routing.yml')); // 3) Add another route $routes->add('/', 'AppBundle:Default:homepage', 'homepage'); // 4) Add another route $routes->add('/admin', 'AppBundle:Admin:dashboard', 'admin_dashboard'); // set a default value $routes->setDefault('_locale', 'fr'); $actualCollection = $routes->build(); $this->assertCount(5, $actualCollection); $actualRouteNames = array_keys($actualCollection->all()); $this->assertEquals(array('checkout_route', 'imported_route1', 'imported_route2', 'homepage', 'admin_dashboard'), $actualRouteNames); // make sure the defaults were set $checkoutRoute = $actualCollection->get('checkout_route'); $defaults = $checkoutRoute->getDefaults(); $this->assertArrayHasKey('_locale', $defaults); $this->assertEquals('fr', $defaults['_locale']); }
/** * Add or import routes into your application. * * $routes->import('config/routing.yml'); * $routes->add('/admin', 'AppBundle:Admin:dashboard', 'admin_dashboard'); * * @param RouteCollectionBuilder $routes */ protected function configureRoutes(RouteCollectionBuilder $routes) { if (isset($_ENV['FORCE_SSL'])) { $routes->setSchemes('https'); } if ($this->getEnvironment() === 'dev') { $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt'); $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler'); $routes->import('@TwigBundle/Resources/config/routing/errors.xml', '/_error'); } $routes->add('/', 'santa.controller:homepage', 'homepage'); $routes->add('/run', 'santa.controller:run', 'run'); $routes->add('/finish/{hash}', 'santa.controller:finish', 'finish'); $routes->add('/summary/{hash}', 'santa.controller:summary', 'summary'); $routes->add('/retry/{hash}', 'santa.controller:retry', 'retry'); $routes->add('/auth', 'santa.controller:authenticate', 'authenticate'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->import(__DIR__ . '/config/routing.yml'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->import(__DIR__ . '/Resources/routing/routing.xml'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->mount('/_wdt', $routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml')); $routes->mount('/_profiler', $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')); $routes->add('/', 'kernel:indexAction', 'index'); }