Skip to content

Commit b07d1e5

Browse files
authored
implement RouterFactory (#37602)
1 parent a06f8c0 commit b07d1e5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

administrator/components/com_privacy/services/provider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99

1010
defined('_JEXEC') or die;
1111

12+
use Joomla\CMS\Component\Router\RouterFactoryInterface;
1213
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
1314
use Joomla\CMS\Extension\ComponentInterface;
1415
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
1516
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
17+
use Joomla\CMS\Extension\Service\Provider\RouterFactory;
1618
use Joomla\CMS\HTML\Registry;
1719
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
1820
use Joomla\Component\Privacy\Administrator\Extension\PrivacyComponent;
@@ -39,6 +41,7 @@ public function register(Container $container)
3941
{
4042
$container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\Privacy'));
4143
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\Privacy'));
44+
$container->registerServiceProvider(new RouterFactory('\\Joomla\\Component\\Privacy'));
4245

4346
$container->set(
4447
ComponentInterface::class,
@@ -48,6 +51,7 @@ function (Container $container)
4851

4952
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
5053
$component->setRegistry($container->get(Registry::class));
54+
$component->setRouterFactory($container->get(RouterFactoryInterface::class));
5155

5256
return $component;
5357
}

administrator/components/com_privacy/src/Extension/PrivacyComponent.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
\defined('JPATH_PLATFORM') or die;
1313

14+
use Joomla\CMS\Component\Router\RouterServiceInterface;
15+
use Joomla\CMS\Component\Router\RouterServiceTrait;
1416
use Joomla\CMS\Extension\BootableExtensionInterface;
1517
use Joomla\CMS\Extension\MVCComponent;
1618
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
@@ -22,9 +24,10 @@
2224
*
2325
* @since 4.0.0
2426
*/
25-
class PrivacyComponent extends MVCComponent implements BootableExtensionInterface
27+
class PrivacyComponent extends MVCComponent implements BootableExtensionInterface, RouterServiceInterface
2628
{
2729
use HTMLRegistryAwareTrait;
30+
use RouterServiceTrait;
2831

2932
/**
3033
* Booting the extension. This is the function to set up the environment of the extension like

0 commit comments

Comments
 (0)