Exemplo n.º 1
0
 /**
  * Returns the Response content for a given controller or URI.
  *
  * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
  * @param array  $attributes An array of request attributes
  * @param array  $options    An array of options
  *
  * @see Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver::render()
  */
 public function render($controller, array $attributes = array(), array $options = array())
 {
     $options['attributes'] = Escaper::unescape($attributes);
     if (isset($options['query'])) {
         $options['query'] = Escaper::unescape($options['query']);
     }
     return $this->resolver->render($controller, $options);
 }
Exemplo n.º 2
0
 /**
  * Returns the Response content for a given controller or URI.
  *
  * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
  * @param array  $options    An array of options
  *
  * @see Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver::render()
  */
 public function render($controller, array $options = array())
 {
     if (isset($options['path'])) {
         $options['path'] = Escaper::unescape($options['path']);
     }
     if (isset($options['query'])) {
         $options['query'] = Escaper::unescape($options['query']);
     }
     return $this->resolver->render($controller, $options);
 }
Exemplo n.º 3
0
 public function testUnescapeUnescapesMixedArrays()
 {
     $object = new OutputEscaperTestClass();
     $input = array('foo' => 'bar', 'bar' => Escaper::escape('entities', '<strong>bar</strong>'), 'foobar' => Escaper::escape('entities', $object));
     $output = array('foo' => 'bar', 'bar' => '<strong>bar</strong>', 'foobar' => $object);
     $this->assertEquals($output, Escaper::unescape($input), '::unescape() unescapes values with some escaped and unescaped values');
 }