vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php line 50

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Bundle\FrameworkBundle\Templating\Helper;
  11. @trigger_error('The '.ActionsHelper::class.' class is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.', \E_USER_DEPRECATED);
  12. use Symfony\Component\HttpKernel\Controller\ControllerReference;
  13. use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
  14. use Symfony\Component\Templating\Helper\Helper;
  15. /**
  16.  * ActionsHelper manages action inclusions.
  17.  *
  18.  * @author Fabien Potencier <fabien@symfony.com>
  19.  *
  20.  * @deprecated since version 4.3, to be removed in 5.0; use Twig instead.
  21.  */
  22. class ActionsHelper extends Helper
  23. {
  24.     private $handler;
  25.     public function __construct(FragmentHandler $handler)
  26.     {
  27.         $this->handler $handler;
  28.     }
  29.     /**
  30.      * Returns the fragment content for a given URI.
  31.      *
  32.      * @param string $uri
  33.      *
  34.      * @return string The fragment content
  35.      *
  36.      * @see FragmentHandler::render()
  37.      */
  38.     public function render($uri, array $options = [])
  39.     {
  40.         $strategy $options['strategy'] ?? 'inline';
  41.         unset($options['strategy']);
  42.         return $this->handler->render($uri$strategy$options);
  43.     }
  44.     public function controller($controller$attributes = [], $query = [])
  45.     {
  46.         return new ControllerReference($controller$attributes$query);
  47.     }
  48.     /**
  49.      * {@inheritdoc}
  50.      */
  51.     public function getName()
  52.     {
  53.         return 'actions';
  54.     }
  55. }