/** * @param RouteCollectionBuilder $routes */ protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->add('/', 'kernel:indexAction', 'index'); $routes->add('/fotky', 'kernel:photosAction', 'photos'); $routes->add('/vtip', 'kernel:jokeAction', 'joke'); $routes->add('/kontakt', 'kernel:contactAction', 'contact'); }
/** * 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'); } $routes->add('/', 'santa.controller:homepage', 'homepage'); $routes->add('/run', 'santa.controller:run', 'run'); $routes->add('/finish/{hash}', 'santa.controller:finish', 'finish'); $routes->add('/auth', 'santa.controller:authenticate', 'authenticate'); $routes->add('/command', 'santa.controller:command', 'command'); }
/** * {@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'); }
/** * {@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'); } }
/** * 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'); }
public function testFlushSetsPrefixedWithMultipleLevels() { $loader = $this->getMock('Symfony\\Component\\Config\\Loader\\LoaderInterface'); $routes = new RouteCollectionBuilder($loader); $routes->add('homepage', 'MainController::homepageAction', 'homepage'); $adminRoutes = $routes->createBuilder(); $adminRoutes->add('/dashboard', 'AdminController::dashboardAction', 'admin_dashboard'); // embedded collection under /admin $adminBlogRoutes = $routes->createBuilder(); $adminBlogRoutes->add('/new', 'BlogController::newAction', 'admin_blog_new'); // mount into admin, but before the parent collection has been mounted $adminRoutes->mount('/blog', $adminBlogRoutes); // now mount the /admin routes, above should all still be /blog/admin $routes->mount('/admin', $adminRoutes); // add a route after mounting $adminRoutes->add('/users', 'AdminController::userAction', 'admin_users'); // add another sub-collection after the mount $otherAdminRoutes = $routes->createBuilder(); $otherAdminRoutes->add('/sales', 'StatsController::indexAction', 'admin_stats_sales'); $adminRoutes->mount('/stats', $otherAdminRoutes); // add a normal collection and see that it is also prefixed $importedCollection = new RouteCollection(); $importedCollection->add('imported_route', new Route('/foo')); // make this loader able to do the import - keeps mocking simple $loader->expects($this->any())->method('supports')->will($this->returnValue(true)); $loader->expects($this->any())->method('load')->will($this->returnValue($importedCollection)); // import this from the /admin route builder $adminRoutes->mount('/imported', $adminRoutes->import('admin.yml')); $collection = $routes->build(); $this->assertEquals('/admin/dashboard', $collection->get('admin_dashboard')->getPath(), 'Routes before mounting have the prefix'); $this->assertEquals('/admin/users', $collection->get('admin_users')->getPath(), 'Routes after mounting have the prefix'); $this->assertEquals('/admin/blog/new', $collection->get('admin_blog_new')->getPath(), 'Sub-collections receive prefix even if mounted before parent prefix'); $this->assertEquals('/admin/stats/sales', $collection->get('admin_stats_sales')->getPath(), 'Sub-collections receive prefix if mounted after parent prefix'); $this->assertEquals('/admin/imported/foo', $collection->get('imported_route')->getPath(), 'Normal RouteCollections are also prefixed properly'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->add('/', 'kernel:indexAction', 'index'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->add('/', 'kernel:micro'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { // kernel is a service that points to this class // optional 3rd argument is the route name $routes->add('/', 'kernel:helloAction'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->add('/wirecard/confirm', 'hochstrasser_wirecard.wirecard_controller:confirmAction', 'wirecard_confirm'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->add('/{path}', 'kernel:indexAction', 'index')->addRequirements(['path' => '.+'])->addDefaults(['path' => '']); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->add('/projects/{project}', 'kernel:projectRedirectAction'); $routes->add('/browse/{issue}', 'kernel:issueRedirectAction'); }
protected function configureRoutes(RouteCollectionBuilder $routes) { $routes->add('/', 'kernel:halloweenAction'); }
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'); }