@@ -418,7 +418,11 @@ and set a new ``Exception`` object, or do nothing::
418
418
response won't work. If you want to overwrite the status code (which you
419
419
should not without a good reason), set the ``X-Status-Code `` header::
420
420
421
- return new Response('Error', 404 /* ignored */, array('X-Status-Code' => 200));
421
+ return new Response(
422
+ 'Error',
423
+ 404 // ignored,
424
+ array('X-Status-Code' => 200)
425
+ );
422
426
423
427
.. index ::
424
428
single: Event Dispatcher
@@ -610,11 +614,19 @@ If you enable the web profiler, you also need to mount the profiler routes:
610
614
611
615
.. code-block :: xml
612
616
613
- <import resource =" @WebProfilerBundle/Resources/config/routing/profiler.xml" prefix =" /_profiler" />
617
+ <import
618
+ resource =" @WebProfilerBundle/Resources/config/routing/profiler.xml"
619
+ prefix =" /_profiler"
620
+ />
614
621
615
622
.. code-block :: php
616
623
617
- $collection->addCollection($loader->import("@WebProfilerBundle/Resources/config/routing/profiler.xml"), '/_profiler');
624
+ $collection->addCollection(
625
+ $loader->import(
626
+ "@WebProfilerBundle/Resources/config/routing/profiler.xml"
627
+ ),
628
+ '/_profiler'
629
+ );
618
630
619
631
As the profiler adds some overhead, you might want to enable it only under
620
632
certain circumstances in the production environment. The ``only-exceptions ``
@@ -626,7 +638,8 @@ portion of the website? You can use a request matcher:
626
638
627
639
.. code-block :: yaml
628
640
629
- # enables the profiler only for request coming for the 192.168.0.0 network
641
+ # enables the profiler only for request coming
642
+ # for the 192.168.0.0 network
630
643
framework :
631
644
profiler :
632
645
matcher : { ip: 192.168.0.0/24 }
@@ -641,14 +654,18 @@ portion of the website? You can use a request matcher:
641
654
profiler :
642
655
matcher : { ip: 192.168.0.0/24, path: "^/admin/" }
643
656
644
- # use a custom matcher instance defined in the "custom_matcher" service
657
+ # use a custom matcher instance defined in
658
+ # the "custom_matcher" service
645
659
framework :
646
660
profiler :
647
661
matcher : { service: custom_matcher }
648
662
649
663
.. code-block :: xml
650
664
651
- <!-- enables the profiler only for request coming for the 192.168.0.0 network -->
665
+ <!--
666
+ enables the profiler only for request coming
667
+ for the 192.168.0.0 network
668
+ -->
652
669
<framework : config >
653
670
<framework : profiler >
654
671
<framework : matcher ip =" 192.168.0.0/24" />
@@ -669,7 +686,10 @@ portion of the website? You can use a request matcher:
669
686
</framework : profiler >
670
687
</framework : config >
671
688
672
- <!-- use a custom matcher instance defined in the "custom_matcher" service -->
689
+ <!--
690
+ use a custom matcher instance defined in
691
+ the "custom_matcher" service
692
+ -->
673
693
<framework : config >
674
694
<framework : profiler >
675
695
<framework : matcher service =" custom_matcher" />
@@ -678,7 +698,8 @@ portion of the website? You can use a request matcher:
678
698
679
699
.. code-block :: php
680
700
681
- // enables the profiler only for request coming for the 192.168.0.0 network
701
+ // enables the profiler only for request coming
702
+ // for the 192.168.0.0 network
682
703
$container->loadFromExtension('framework', array(
683
704
'profiler' => array(
684
705
'matcher' => array('ip' => '192.168.0.0/24'),
@@ -695,11 +716,15 @@ portion of the website? You can use a request matcher:
695
716
// combine rules
696
717
$container->loadFromExtension('framework', array(
697
718
'profiler' => array(
698
- 'matcher' => array('ip' => '192.168.0.0/24', 'path' => '^/admin/'),
719
+ 'matcher' => array(
720
+ 'ip' => '192.168.0.0/24',
721
+ 'path' => '^/admin/',
722
+ ),
699
723
),
700
724
));
701
725
702
- # use a custom matcher instance defined in the "custom_matcher" service
726
+ // use a custom matcher instance defined in
727
+ // the "custom_matcher" service
703
728
$container->loadFromExtension('framework', array(
704
729
'profiler' => array(
705
730
'matcher' => array('service' => 'custom_matcher'),
0 commit comments