Component-Builder/admin/compiler/joomla_4/SITE_ROUTER.php
Robot d1e1a56671
Stable release of v3.2.0-beta1
Move beta to main repo. Fix #1053 so that the right and left tabs display correctly in Joomla 4&5.
2024-03-02 22:10:30 +02:00

98 lines
2.3 KiB
PHP

<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this JCB template file (EVER)
defined('_JCB_TEMPLATE') or die;
?>
###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Service;
###SITE_ROUTER_HEADER###
// No direct access to this file
\defined('_JEXEC') or die;
/**
* Router class for the ###Component_name### Component
*
* @since 3.10
*/
class Router extends RouterView
{
/**
* Flag to remove IDs
*
* @var boolean
* @since 4.0.0
*/
protected $noIDs = false;
/**
* The category factory
*
* @var CategoryFactoryInterface
* @since 4.0.0
*/
private $categoryFactory;
/**
* The category cache
*
* @var array
* @since 4.0.0
*/
private $categoryCache = [];
/**
* The db
*
* @var DatabaseInterface
* @since 4.0.0
*/
private $db;
/**
* The component params
*
* @var Registry
* @since 4.0.0
*/
private $params;
/**
* ###Component### Component router constructor
*
* @param SiteApplication $app The application object
* @param AbstractMenu $menu The menu object to work with
* @param CategoryFactoryInterface $categoryFactory The category object
* @param DatabaseInterface $db The database object
*
* @since 4.0.0
*/
public function __construct(
SiteApplication $app,
AbstractMenu $menu,
CategoryFactoryInterface $categoryFactory,
DatabaseInterface $db)
{
$this->categoryFactory = $categoryFactory;
$this->db = $db;
$this->params = ComponentHelper::getParams('com_###component###');
$this->noIDs = (bool) $this->params->get('sef_ids', false);###SITE_ROUTER_CONSTRUCTOR_BEFORE_PARENT###
parent::__construct($app, $menu);###SITE_ROUTER_CONSTRUCTOR_AFTER_PARENT###
$this->attachRule(new MenuRules($this));
$this->attachRule(new StandardRules($this));
$this->attachRule(new NomenuRules($this));
}###SITE_ROUTER_METHODS###
}