[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/phpbb/template/twig/extension/ -> routing.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\template\twig\extension;
  15  
  16  use Symfony\Bridge\Twig\Extension\RoutingExtension;
  17  use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  18  
  19  class routing extends RoutingExtension
  20  {
  21      /** @var \phpbb\controller\helper */
  22      protected $helper;
  23  
  24      /**
  25      * Constructor
  26      *
  27      * @param \phpbb\routing\helper $helper
  28      */
  29  	public function __construct(\phpbb\routing\helper $helper)
  30      {
  31          $this->helper = $helper;
  32      }
  33  
  34  	public function getPath($name, $parameters = array(), $relative = false)
  35      {
  36          return $this->helper->route($name, $parameters, true, false, $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH);
  37      }
  38  
  39  	public function getUrl($name, $parameters = array(), $schemeRelative = false)
  40      {
  41          return $this->helper->route($name, $parameters, true, false, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
  42      }
  43  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1