MicroKernelTrait
trait MicroKernelTrait
Ядро, предоставляющее возможности для настройки.
Методы
| configureRoutes(RouteCollectionBuilder $routes) Добавление или импорт маршрутов в ваше приложение. | ||
| configureContainer(ContainerBuilder $c, LoaderInterface $loader) Настройка контейнера. | ||
| registerContainerConfiguration(LoaderInterface $loader) {@inheritdoc} | ||
| loadRoutes(LoaderInterface $loader) |
Подробности
abstract protected configureRoutes(RouteCollectionBuilder $routes)
Добавление или импорт маршрутов в ваше приложение.
$routes->import('config/routing.yml'); $routes->add('/admin', 'App\Controller\AdminController::dashboard', 'admin_dashboard');
Параметры
| RouteCollectionBuilder | $routes |
abstract protected configureContainer(ContainerBuilder $c, LoaderInterface $loader)
Настройка контейнера.
Вы можете зарегистрировать расширения:
$c->loadFromExtension('framework', array(
'secret' => '%secret%'
));
Или сервисы:
$c->register('halloween', 'FooBundle\HalloweenProvider');
Или параметры:
$c->setParameter('halloween', 'lot of fun');
Параметры
| ContainerBuilder | $c | |
| LoaderInterface | $loader |
registerContainerConfiguration(LoaderInterface $loader)
{@inheritdoc}
Параметры
| LoaderInterface | $loader |
loadRoutes(LoaderInterface $loader)
Параметры
| LoaderInterface | $loader |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.html