@@ -592,7 +592,7 @@ each event has their own event object:
592592===================== ================================ ===================================================================================
593593Name ``KernelEvents `` Constant Argument passed to the listener
594594===================== ================================ ===================================================================================
595- kernel.request ``KernelEvents::REQUEST `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseEvent `
595+ kernel.request ``KernelEvents::REQUEST `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseEvent `
596596kernel.controller ``KernelEvents::CONTROLLER `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ FilterControllerEvent `
597597kernel.view ``KernelEvents::VIEW `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseForControllerResultEvent `
598598kernel.response ``KernelEvents::RESPONSE `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ FilterResponseEvent `
@@ -701,6 +701,32 @@ look like this::
701701 // ...
702702 }
703703
704+ .. _http-kernel-resource-locator :
705+
706+ Locating Resources
707+ ------------------
708+
709+ The HttpKernel component is responsible of the bundle mechanism used in Symfony
710+ applications. The key feature of the bundles is that they allow to override any
711+ resource used by the application (config files, templates, controllers,
712+ translation files, etc.)
713+
714+ This overriding mechanism works because resources are referenced not by their
715+ physical path but by their logical path. For example, the ``services.xml `` file
716+ stored in the ``Resources/config/ `` directory of a bundle called AppBundle is
717+ referenced as ``@AppBundle/Resources/config/services.xml ``. This logical path
718+ will work when the application overrides that file and even if you change the
719+ directory of AppBundle.
720+
721+ The HttpKernel component provides a method called :method: `Symfony\\ Component\\ HttpKernel\\ Kernel::locateResource `
722+ which can be used to transform logical paths into physical paths::
723+
724+ use Symfony\Component\HttpKernel\HttpKernel;
725+
726+ // ...
727+ $kernel = new HttpKernel($dispatcher, $resolver);
728+ $path = $kernel->locateResource('@AppBundle/Resources/config/services.xml');
729+
704730Learn more
705731----------
706732
0 commit comments