[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_admin 6 * 7 * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 defined('_JEXEC') or die; 12 13 use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; 14 use Joomla\CMS\Extension\ComponentInterface; 15 use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory; 16 use Joomla\CMS\Extension\Service\Provider\MVCFactory; 17 use Joomla\CMS\HTML\Registry; 18 use Joomla\CMS\MVC\Factory\MVCFactoryInterface; 19 use Joomla\Component\Admin\Administrator\Extension\AdminComponent; 20 use Joomla\DI\Container; 21 use Joomla\DI\ServiceProviderInterface; 22 23 /** 24 * The admin service provider. 25 * 26 * @since 4.0.0 27 */ 28 return new class implements ServiceProviderInterface 29 { 30 /** 31 * Registers the service provider with a DI container. 32 * 33 * @param Container $container The DI container. 34 * 35 * @return void 36 * 37 * @since 4.0.0 38 */ 39 public function register(Container $container) 40 { 41 $container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\Admin')); 42 $container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\Admin')); 43 44 $container->set( 45 ComponentInterface::class, 46 function (Container $container) { 47 $component = new AdminComponent($container->get(ComponentDispatcherFactoryInterface::class)); 48 49 $component->setMVCFactory($container->get(MVCFactoryInterface::class)); 50 $component->setRegistry($container->get(Registry::class)); 51 52 return $component; 53 } 54 ); 55 } 56 };
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |