MicroKernelTrait
trait MicroKernelTrait
A Kernel that provides configuration hooks.
Methods
configureRoutes(RouteCollectionBuilder $routes) Add or import routes into your application. | ||
configureContainer(ContainerBuilder $c, LoaderInterface $loader) Configures the container. | ||
registerContainerConfiguration(LoaderInterface $loader) {@inheritdoc} | ||
loadRoutes(LoaderInterface $loader) |
Details
abstract protected configureRoutes(RouteCollectionBuilder $routes)
Add or import routes into your application.
$routes->import('config/routing.yml'); $routes->add('/admin', 'App\Controller\AdminController::dashboard', 'admin_dashboard');
Parameters
RouteCollectionBuilder | $routes |
abstract protected configureContainer(ContainerBuilder $c, LoaderInterface $loader)
Configures the container.
You can register extensions:
$c->loadFromExtension('framework', array(
'secret' => '%secret%'
));
Or services:
$c->register('halloween', 'FooBundle\HalloweenProvider');
Or parameters:
$c->setParameter('halloween', 'lot of fun');
Parameters
ContainerBuilder | $c | |
LoaderInterface | $loader |
registerContainerConfiguration(LoaderInterface $loader)
{@inheritdoc}
Parameters
LoaderInterface | $loader |
loadRoutes(LoaderInterface $loader)
Parameters
LoaderInterface | $loader |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.html