. */ namespace Alledia\Framework\Joomla\Extension; defined('_JEXEC') or die(); use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; class Component extends Licensed { /** * @var BaseController */ protected $controller; /** * @inheritDoc */ public function __construct($namespace) { parent::__construct($namespace, 'component'); $this->loadLibrary(); } /** * Load the main controller * * @return void * @throws \Exception */ public function loadController() { if (!isset($this->controller)) { jimport('legacy.controller.legacy'); $this->controller = BaseController::getInstance($this->namespace); } } /** * @return void * @throws \Exception */ public function executeTask() { $task = Factory::getApplication()->input->getCmd('task'); $this->controller->execute($task); $this->controller->redirect(); } }