Frontend\Core\Engine\Block\Extra::__construct PHP Метод

__construct() публичный Метод

public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel, string $module, string $action, mixed $data = null )
$kernel Symfony\Component\HttpKernel\KernelInterface
$module string The module to load.
$action string The action to load.
$data mixed The data that was passed from the database.
    public function __construct(KernelInterface $kernel, $module, $action, $data = null)
    {
        parent::__construct($kernel);
        // set properties
        $this->setModule($module);
        $this->setAction($action);
        if ($data !== null) {
            $this->setData($data);
        }
        // load the config file for the required module
        $this->loadConfig();
        // is the requested action possible? If not we throw an exception.
        // We don't redirect because that could trigger a redirect loop
        if (!in_array($this->getAction(), $this->config->getPossibleActions())) {
            $this->setAction($this->config->getDefaultAction());
        }
    }