- md5
- 093c5778a352cb70ab7b2d7daf8aec56
- sha1
- fed94b0d55c5527153dcd1e564e11d4d1fec173a
- sha256
- 240ef6d8dd76a5c371a2e309c45d9fbefa326ac70b98107e3808c42beba71015
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
<?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Extension;
\defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Dispatcher\DispatcherInterface;
use Joomla\CMS\Dispatcher\ModuleDispatcherFactoryInterface;
use Joomla\CMS\Helper\HelperFactoryInterface;
use Joomla\Input\Input;
/**
* Access to module specific services.
*
* @since 4.0.0
*/
class Module implements ModuleInterface, HelperFactoryInterface
{
/**
* The dispatcher factory.
*
* @var ModuleDispatcherFactoryInterface
*
* @since 4.0.0
*/
private $dispatcherFactory;
/**
* The helper factory.
*
* @var HelperFactoryInterface
*
* @since 4.0.0
*/
private $helperFactory;
/**
* Module constructor.
*
* @param ModuleDispatcherFactoryInterface $dispatcherFactory The dispatcher factory
* @param HelperFactoryInterface $helperFactory The helper factory
*
* @since 4.0.0
*/
public function __construct(ModuleDispatcherFactoryInterface $dispatcherFactory, HelperFactoryInterface $helperFactory)
{
$this->dispatcherFactory = $dispatcherFactory;
$this->helperFactory = $helperFactory;
}
/**
* Returns the dispatcher for the given application, module and input.
*
* @param \stdClass $module The module
* @param CMSApplicationInterface $application The application
* @param Input $input The input object, defaults to the one in the application
*
* @return DispatcherInterface
*
* @since 4.0.0
*/
public function getDispatcher(\stdClass $module, CMSApplicationInterface $application, Input $input = null): DispatcherInterface
{
return $this->dispatcherFactory->createDispatcher($module, $application, $input);
}
/**
* Returns a helper instance for the given name.
*
* @param string $name The name
* @param array $config The config
*
* @return \stdClass
*
* @since 4.0.0
*/
public function getHelper(string $name, array $config = [])
{
return $this->helperFactory->getHelper($name, $config);
}
}
The same content is in 46 releases, Joomla 4.0.0-rc1 to 4.2.0-alpha2. See them all, or every version of this file.