Skip to content

Commit ffd7507

Browse files
committed
minor #107 fix bugs due to choosing the wrong base branch (xabbuh)
This PR was merged into the 2.8 branch. Discussion ---------- fix bugs due to choosing the wrong base branch Commits ------- 54a145c fix some issues after merging 2.7 into 2.8
2 parents 6656856 + 54a145c commit ffd7507

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

form/action_method.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ to the ``form()`` or the ``form_start()`` helper functions:
4949

5050
<!-- app/Resources/views/default/newAction.html.php -->
5151
<?php echo $view['form']->start($form, array(
52-
'action' => $view['router']->generate('target_route'),
52+
// The path() method was introduced in Symfony 2.8. Prior to 2.8,
53+
// you had to use generate().
54+
'action' => $view['router']->path('target_route'),
5355
'method' => 'GET',
5456
)) ?>
5557

http_cache/esi.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags:
151151
<?php echo $view['actions']->render(
152152
// The url() method was introduced in Symfony 2.8. Prior to 2.8,
153153
// you had to use generate($name, $parameters, UrlGeneratorInterface::ABSOLUTE_URL)
154-
$view['router']->generate(
154+
$view['router']->path(
155155
'latest_news',
156156
array('maxPerPage' => 5)
157157
),

routing/debug.rst

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ the command by running the following from the root of your project.
1313
1414
$ php app/console debug:router
1515
16-
.. versionadded:: 2.6
17-
Prior to Symfony 2.6, this command was called ``router:debug``.
18-
1916
This command will print a helpful list of *all* the configured routes in
2017
your application:
2118

routing/generate_url_javascript.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ variables. The ``escape`` function helps escape any non-JavaScript-safe values:
1616

1717
<script>
1818
var route = "<?php echo $view->escape(
19-
$view['router']->generate('blog_show', array(
19+
$view['router']->path('blog_show', array(
2020
'slug' => 'my-blog-post',
2121
)),
2222
'js'
2323
) ?>";
2424
</script>
2525

26+
.. versionadded:: 2.8
27+
The ``path()`` PHP templating helper was introduced in Symfony 2.8. Prior
28+
to 2.8, you had to use the ``generate()`` helper method.
29+
2630
But if you *actually* need to generate routes in pure JavaScript, consider using
2731
the `FOSJsRoutingBundle`_. It makes the following possible:
2832

templating/formats.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ key in the parameter hash:
4949

5050
.. code-block:: html+php
5151

52-
<a href="<?php echo $view['router']->generate('article_show', array(
52+
<!-- The path() method was introduced in Symfony 2.8. Prior to 2.8, you
53+
had to use generate(). -->
54+
<a href="<?php echo $view['router']->path('article_show', array(
5355
'id' => 123,
5456
'_format' => 'pdf',
5557
)) ?>">

templating/render_without_controller.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ this is probably only useful if you'd like to cache this page partial (see
7272
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
7373
?>
7474

75+
<!-- The url() method was introduced in Symfony 2.8. Prior to 2.8, you
76+
had to use generate() with UrlGeneratorInterface::ABSOLUTE_URL
77+
passed as the third argument. -->
7578
<?php echo $view['actions']->render(
76-
$view['router']->generate('acme_privacy', array(), UrlGeneratorInterface::ABSOLUTE_URL)
79+
$view['router']->url('acme_privacy', array())
7780
) ?>
7881

7982
.. _templating-no-controller-caching:

0 commit comments

Comments
 (0)