[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Component/Router/ -> RouterBase.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2014 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\Component\Router;
  11  
  12  use Joomla\CMS\Factory;
  13  
  14  // phpcs:disable PSR1.Files.SideEffects
  15  \defined('JPATH_PLATFORM') or die;
  16  // phpcs:enable PSR1.Files.SideEffects
  17  
  18  /**
  19   * Base component routing class
  20   *
  21   * @since  3.3
  22   */
  23  abstract class RouterBase implements RouterInterface
  24  {
  25      /**
  26       * Application object to use in the router
  27       *
  28       * @var    \Joomla\CMS\Application\CMSApplication
  29       * @since  3.4
  30       */
  31      public $app;
  32  
  33      /**
  34       * Menu object to use in the router
  35       *
  36       * @var    \Joomla\CMS\Menu\AbstractMenu
  37       * @since  3.4
  38       */
  39      public $menu;
  40  
  41      /**
  42       * Class constructor.
  43       *
  44       * @param   \Joomla\CMS\Application\CMSApplication  $app   Application-object that the router should use
  45       * @param   \Joomla\CMS\Menu\AbstractMenu           $menu  Menu-object that the router should use
  46       *
  47       * @since   3.4
  48       */
  49      public function __construct($app = null, $menu = null)
  50      {
  51          if ($app) {
  52              $this->app = $app;
  53          } else {
  54              $this->app = Factory::getApplication();
  55          }
  56  
  57          if ($menu) {
  58              $this->menu = $menu;
  59          } else {
  60              $this->menu = $this->app->getMenu();
  61          }
  62      }
  63  
  64      /**
  65       * Generic method to preprocess a URL
  66       *
  67       * @param   array  $query  An associative array of URL arguments
  68       *
  69       * @return  array  The URL arguments to use to assemble the subsequent URL.
  70       *
  71       * @since   3.3
  72       */
  73      public function preprocess($query)
  74      {
  75          return $query;
  76      }
  77  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer