Skip to content
This repository
Browse code

[FrameworkBundle] restricted to only URIs the first argument of the a…

…ctions helper
  • Loading branch information...
commit 3341c8ec43ba89ba67623d502471c546961a55ac 1 parent b7e4cff
Fabien Potencier fabpot authored
16 UPGRADE-2.2.md
Source Rendered
@@ -364,6 +364,22 @@
364 364
365 365 ### FrameworkBundle
366 366
  367 + * The `render` method of the `actions` templating helper signature and arguments changed:
  368 +
  369 + Before:
  370 +
  371 + ```
  372 + <?php echo $view['actions']->render('BlogBundle:Post:list', array('limit' => 2), array('alt' => 'BlogBundle:Post:error')) ?>
  373 + ```
  374 +
  375 + After:
  376 +
  377 + ```
  378 + <?php echo $view['actions']->render($view['router']->generate('post_list', array('limit' => 2)), array('alt' => 'BlogBundle:Post:error')) ?>
  379 + ```
  380 +
  381 + where `post_list` is the route name for the `BlogBundle:Post:list` controller.
  382 +
367 383 #### Configuration
368 384
369 385 * The 2.2 version introduces a new parameter `trusted_proxies` that replaces
1  src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Source Rendered
@@ -8,6 +8,7 @@ CHANGELOG
8 8 * `Symfony\Bundle\FrameworkBundle\HttpKernel::render()` method signature changed and the first argument
9 9 must now be a URI (the `generateInternalUri()` method was removed)
10 10 * The internal routes have been removed (`Resources/config/routing/internal.xml`)
  11 + * The `render` method of the `actions` templating helper signature and arguments changed:
11 12 * replaced Symfony\Bundle\FrameworkBundle\Controller\TraceableControllerResolver by Symfony\Component\HttpKernel\Controller\TraceableControllerResolver
12 13 * replaced Symfony\Component\HttpKernel\Debug\ContainerAwareTraceableEventDispatcher by Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
13 14 * added Client::enableProfiler()
13 src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php
@@ -34,21 +34,18 @@ public function __construct(HttpKernel $kernel)
34 34 }
35 35
36 36 /**
37   - * Returns the Response content for a given controller or URI.
  37 + * Returns the Response content for a given URI.
38 38 *
39   - * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
40   - * @param array $attributes An array of request attributes
41   - * @param array $options An array of options
  39 + * @param string $uri A URI
  40 + * @param array $options An array of options
42 41 *
43 42 * @return string
44 43 *
45 44 * @see Symfony\Bundle\FrameworkBundle\HttpKernel::render()
46 45 */
47   - public function render($controller, array $attributes = array(), array $options = array())
  46 + public function render($uri, array $options = array())
48 47 {
49   - $options['attributes'] = $attributes;
50   -
51   - return $this->kernel->render($controller, $options);
  48 + return $this->kernel->render($uri, $options);
52 49 }
53 50
54 51 /**

0 comments on commit 3341c8e

Please sign in to comment.
Something went wrong with that request. Please try again.