37 lines
1.0 KiB
PHP
37 lines
1.0 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @copyright Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||
|
|
* @license GPL-3.0-or-later
|
||
|
|
* @author Moko Consulting
|
||
|
|
*/
|
||
|
|
|
||
|
|
\defined('_JEXEC') or die;
|
||
|
|
|
||
|
|
use Joomla\CMS\Extension\PluginInterface;
|
||
|
|
use Joomla\CMS\Factory;
|
||
|
|
use Joomla\CMS\Plugin\PluginHelper;
|
||
|
|
use Joomla\DI\Container;
|
||
|
|
use Joomla\DI\ServiceProviderInterface;
|
||
|
|
use Joomla\Event\DispatcherInterface;
|
||
|
|
use Moko\Plugin\System\MokoSuiteField\Extension\MokoSuiteField;
|
||
|
|
|
||
|
|
return new class () implements ServiceProviderInterface {
|
||
|
|
public function register(Container $container): void
|
||
|
|
{
|
||
|
|
$container->set(
|
||
|
|
PluginInterface::class,
|
||
|
|
function (Container $container) {
|
||
|
|
$dispatcher = $container->get(DispatcherInterface::class);
|
||
|
|
$plugin = new MokoSuiteField(
|
||
|
|
$dispatcher,
|
||
|
|
(array) PluginHelper::getPlugin('system', 'mokosuitefield')
|
||
|
|
);
|
||
|
|
$plugin->setApplication(Factory::getApplication());
|
||
|
|
|
||
|
|
return $plugin;
|
||
|
|
}
|
||
|
|
);
|
||
|
|
}
|
||
|
|
};
|