18 lines
707 B
PHP
18 lines
707 B
PHP
|
|
<?php
|
||
|
|
defined('_JEXEC') or die;
|
||
|
|
use Joomla\CMS\Extension\ComponentInterface;
|
||
|
|
use Joomla\CMS\Extension\MVCComponent;
|
||
|
|
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
|
||
|
|
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||
|
|
use Joomla\DI\Container;
|
||
|
|
use Joomla\DI\ServiceProviderInterface;
|
||
|
|
return new class implements ServiceProviderInterface {
|
||
|
|
public function register(Container $container): void {
|
||
|
|
$container->set(ComponentInterface::class, function (Container $container) {
|
||
|
|
$c = new MVCComponent($container->get(ComponentDispatcherFactoryInterface::class));
|
||
|
|
$c->setMVCFactory($container->get(MVCFactoryInterface::class));
|
||
|
|
return $c;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
};
|