Skip to content

Commit 4760bf4

Browse files
bocharsky-bwwouterj
authored andcommitted
Replace title placeholder name with slug
As we show slug in examples further: - /articles/en/2010/my-post - /articles/fr/2010/my-post.rss - /articles/en/2013/my-latest-post.html
1 parent 7a02e0c commit 4760bf4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

routing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ With all of this in mind, check out this advanced example:
363363
{
364364
/**
365365
* @Route(
366-
* "/articles/{_locale}/{year}/{title}.{_format}",
366+
* "/articles/{_locale}/{year}/{slug}.{_format}",
367367
* defaults={"_format": "html"},
368368
* requirements={
369369
* "_locale": "en|fr",
@@ -372,7 +372,7 @@ With all of this in mind, check out this advanced example:
372372
* }
373373
* )
374374
*/
375-
public function showAction($_locale, $year, $title)
375+
public function showAction($_locale, $year, $slug)
376376
{
377377
}
378378
}
@@ -381,7 +381,7 @@ With all of this in mind, check out this advanced example:
381381
382382
# app/config/routing.yml
383383
article_show:
384-
path: /articles/{_locale}/{year}/{title}.{_format}
384+
path: /articles/{_locale}/{year}/{slug}.{_format}
385385
defaults: { _controller: AppBundle:Article:show, _format: html }
386386
requirements:
387387
_locale: en|fr
@@ -398,7 +398,7 @@ With all of this in mind, check out this advanced example:
398398
http://symfony.com/schema/routing/routing-1.0.xsd">
399399
400400
<route id="article_show"
401-
path="/articles/{_locale}/{year}/{title}.{_format}">
401+
path="/articles/{_locale}/{year}/{slug}.{_format}">
402402
403403
<default key="_controller">AppBundle:Article:show</default>
404404
<default key="_format">html</default>
@@ -418,7 +418,7 @@ With all of this in mind, check out this advanced example:
418418
$collection = new RouteCollection();
419419
$collection->add(
420420
'article_show',
421-
new Route('/articles/{_locale}/{year}/{title}.{_format}', array(
421+
new Route('/articles/{_locale}/{year}/{slug}.{_format}', array(
422422
'_controller' => 'AppBundle:Article:show',
423423
'_format' => 'html',
424424
), array(

0 commit comments

Comments
 (0)