/**
* Get component router
*
* @param string $component Name of the component including com_ prefix
*
* @return RouterInterface Component router
*
* @since 3.3
*/
public function getComponentRouter($component)
{
if (!isset($this->componentRouters[$component])) {
$componentInstance = $this->app->bootComponent($component);
if ($componentInstance instanceof RouterServiceInterface) {
$this->componentRouters[$component] = $componentInstance->createRouter($this->app, $this->menu);
}
if (!isset($this->componentRouters[$component])) {
$this->componentRouters[$component] = new RouterLegacy(ucfirst(substr($component, 4)));
}
}
return $this->componentRouters[$component];
}