. */ namespace SP\Modules\Web\Controllers\Helpers; use SP\Config\Config; use SP\Config\ConfigData; use SP\Core\Events\EventDispatcher; use SP\Core\Session\Session; use SP\Core\Traits\InjectableTrait; use SP\Mvc\View\Template; /** * Class HelperBase * * @package SP\Modules\Web\Controllers\Helpers */ abstract class HelperBase { use InjectableTrait; /** * @var \SP\Mvc\View\Template */ protected $view; /** * @var ConfigData */ protected $configData; /** * @var Session */ protected $session; /** * @var EventDispatcher */ protected $eventDispatcher; /** * @var Config */ protected $config; /** * Constructor * * @param \SP\Mvc\View\Template $template * @param Config $config * @param Session $session * @param EventDispatcher $eventDispatcher */ final public function __construct(Template $template, Config $config, Session $session, EventDispatcher $eventDispatcher) { $this->injectDependencies(); $this->view = $template; $this->config = $config; $this->configData = $config->getConfigData(); $this->session = $session; $this->eventDispatcher = $eventDispatcher; if (method_exists($this, 'initialize')) { $this->initialize(); } } }