File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,35 @@ class in your controllers to manage the profiler programmatically::
29
29
// ...
30
30
}
31
31
}
32
+
33
+ In order for the profiler to be injected into your controller you need to
34
+ create an alias pointing to the existing ``profiler `` service:
35
+
36
+ .. configuration-block ::
37
+
38
+ .. code-block :: yaml
39
+
40
+ # config/services.yaml
41
+ services :
42
+ Symfony\Component\HttpKernel\Profiler\Profiler : ' @profiler'
43
+
44
+ .. code-block :: xml
45
+
46
+ <!-- config/services.xml -->
47
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
48
+ <container xmlns =" http://symfony.com/schema/dic/services"
49
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
50
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
51
+ http://symfony.com/schema/dic/services/services-1.0.xsd" >
52
+
53
+ <services >
54
+ <service id =" Symfony\Component\HttpKernel\Profiler\Profiler" alias =" profiler" />
55
+ </services >
56
+ </container >
57
+
58
+ .. code-block :: php
59
+
60
+ // config/services.php
61
+ use Symfony\Component\HttpKernel\Profiler\Profiler;
62
+
63
+ $container->setAlias(Profiler::class, 'profiler');
You can’t perform that action at this time.
0 commit comments