[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * Joomla! Content Management System 5 * 6 * @copyright (C) 2017 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\Service\Provider; 11 12 use Joomla\CMS\Cache\CacheControllerFactoryInterface; 13 use Joomla\CMS\Document\Factory; 14 use Joomla\CMS\Document\FactoryInterface; 15 use Joomla\DI\Container; 16 use Joomla\DI\ServiceProviderInterface; 17 18 // phpcs:disable PSR1.Files.SideEffects 19 \defined('JPATH_PLATFORM') or die; 20 // phpcs:enable PSR1.Files.SideEffects 21 22 /** 23 * Service provider for the application's document dependency 24 * 25 * @since 4.0.0 26 */ 27 class Document implements ServiceProviderInterface 28 { 29 /** 30 * Registers the service provider with a DI container. 31 * 32 * @param Container $container The DI container. 33 * 34 * @return void 35 * 36 * @since 4.0.0 37 */ 38 public function register(Container $container) 39 { 40 $container->alias('document.factory', FactoryInterface::class) 41 ->alias(Factory::class, FactoryInterface::class) 42 ->share( 43 FactoryInterface::class, 44 function (Container $container) { 45 $factory = new Factory(); 46 $factory->setCacheControllerFactory($container->get(CacheControllerFactoryInterface::class)); 47 48 return $factory; 49 }, 50 true 51 ); 52 } 53 }
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 |