@@ -578,7 +578,7 @@ the routing configuration. Later, if you want to modify the URL of a particular
578
578
page, all you'll need to do is change the routing configuration; the templates
579
579
will automatically generate the new URL.
580
580
581
- First, link to the "_welcome " page, which is accessible via the following routing
581
+ First, link to the "welcome " page, which is accessible via the following routing
582
582
configuration:
583
583
584
584
.. configuration-block ::
@@ -593,7 +593,7 @@ configuration:
593
593
class WelcomeController extends Controller
594
594
{
595
595
/**
596
- * @Route("/", name="_welcome ")
596
+ * @Route("/", name="welcome ")
597
597
*/
598
598
public function indexAction()
599
599
{
@@ -604,7 +604,7 @@ configuration:
604
604
.. code-block :: yaml
605
605
606
606
# app/config/routing.yml
607
- _welcome :
607
+ welcome :
608
608
path : /
609
609
defaults : { _controller: AppBundle:Welcome:index }
610
610
@@ -617,7 +617,7 @@ configuration:
617
617
xsi : schemaLocation =" http://symfony.com/schema/routing
618
618
http://symfony.com/schema/routing/routing-1.0.xsd" >
619
619
620
- <route id =" _welcome " path =" /" >
620
+ <route id =" welcome " path =" /" >
621
621
<default key =" _controller" >AppBundle:Welcome:index</default >
622
622
</route >
623
623
</routes >
@@ -629,7 +629,7 @@ configuration:
629
629
use Symfony\Component\Routing\RouteCollection;
630
630
631
631
$collection = new RouteCollection();
632
- $collection->add('_welcome ', new Route('/', array(
632
+ $collection->add('welcome ', new Route('/', array(
633
633
'_controller' => 'AppBundle:Welcome:index',
634
634
)));
635
635
@@ -641,11 +641,11 @@ To link to the page, just use the ``path`` Twig function and refer to the route:
641
641
642
642
.. code-block :: html+twig
643
643
644
- <a href="{{ path('_welcome ') }}">Home</a>
644
+ <a href="{{ path('welcome ') }}">Home</a>
645
645
646
646
.. code-block :: html+php
647
647
648
- <a href="<?php echo $view['router']->generate('_welcome ') ?>">Home</a>
648
+ <a href="<?php echo $view['router']->generate('welcome ') ?>">Home</a>
649
649
650
650
As expected, this will generate the URL ``/ ``. Now, for a more complicated
651
651
route:
@@ -737,7 +737,7 @@ correctly:
737
737
738
738
.. code-block :: html+twig
739
739
740
- <a href="{{ url('_welcome ') }}">Home</a>
740
+ <a href="{{ url('welcome ') }}">Home</a>
741
741
742
742
The same can be done in PHP templates by passing a third argument to
743
743
the ``generate() `` method:
@@ -749,7 +749,7 @@ correctly:
749
749
?>
750
750
751
751
<a href="<?php echo $view['router']->generate(
752
- '_welcome ',
752
+ 'welcome ',
753
753
array(),
754
754
UrlGeneratorInterface::ABSOLUTE_URL
755
755
) ?>">Home</a>
0 commit comments