@@ -592,7 +592,7 @@ each event has their own event object:
592
592
===================== ================================ ===================================================================================
593
593
Name ``KernelEvents `` Constant Argument passed to the listener
594
594
===================== ================================ ===================================================================================
595
- kernel.request ``KernelEvents::REQUEST `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseEvent `
595
+ kernel.request ``KernelEvents::REQUEST `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseEvent `
596
596
kernel.controller ``KernelEvents::CONTROLLER `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ FilterControllerEvent `
597
597
kernel.view ``KernelEvents::VIEW `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ GetResponseForControllerResultEvent `
598
598
kernel.response ``KernelEvents::RESPONSE `` :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ FilterResponseEvent `
@@ -701,6 +701,32 @@ look like this::
701
701
// ...
702
702
}
703
703
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
+
704
730
Learn more
705
731
----------
706
732
0 commit comments