[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/symfony/twig-bridge/Extension/ -> HttpKernelRuntime.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the Symfony package.
   5   *
   6   * (c) Fabien Potencier <fabien@symfony.com>
   7   *
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  namespace Symfony\Bridge\Twig\Extension;
  13  
  14  use Symfony\Component\HttpKernel\Controller\ControllerReference;
  15  use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
  16  
  17  /**
  18   * Provides integration with the HttpKernel component.
  19   *
  20   * @author Fabien Potencier <fabien@symfony.com>
  21   */
  22  class HttpKernelRuntime
  23  {
  24      private $handler;
  25  
  26      public function __construct(FragmentHandler $handler)
  27      {
  28          $this->handler = $handler;
  29      }
  30  
  31      /**
  32       * Renders a fragment.
  33       *
  34       * @param string|ControllerReference $uri     A URI as a string or a ControllerReference instance
  35       * @param array                      $options An array of options
  36       *
  37       * @return string The fragment content
  38       *
  39       * @see FragmentHandler::render()
  40       */
  41      public function renderFragment($uri, $options = [])
  42      {
  43          $strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
  44          unset($options['strategy']);
  45  
  46          return $this->handler->render($uri, $strategy, $options);
  47      }
  48  
  49      /**
  50       * Renders a fragment.
  51       *
  52       * @param string                     $strategy A strategy name
  53       * @param string|ControllerReference $uri      A URI as a string or a ControllerReference instance
  54       * @param array                      $options  An array of options
  55       *
  56       * @return string The fragment content
  57       *
  58       * @see FragmentHandler::render()
  59       */
  60      public function renderFragmentStrategy($strategy, $uri, $options = [])
  61      {
  62          return $this->handler->render($uri, $strategy, $options);
  63      }
  64  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1