setEventManager example

EscaperInterface $escaper,
        array $templateConfig,
        array $securityConfig,
        array $backendOptions
    ) {
        $template = Enlight_Class::Instance(Enlight_Template_Manager::class[null, $backendOptions]);
        \assert($template instanceof Enlight_Template_Manager);

        $template->enableSecurity(new Security($template$securityConfig));

        $template->setOptions($templateConfig);
        $template->setEventManager($eventManager);

        $template->registerResource('snippet', $snippetResource);
        /* @phpstan-ignore-next-line is handled by magic method `\Smarty_Internal_TemplateBase::__call` and will set the property `\Smarty::$default_resource_type` */
        $template->setDefaultResourceType('snippet');

        $template->registerPlugin(Smarty::PLUGIN_MODIFIER, 'escapeHtml', [$escaper, 'escapeHtml']);
        $template->registerPlugin(Smarty::PLUGIN_MODIFIER, 'escapeHtmlAttr', [$escaper, 'escapeHtmlAttr']);
        $template->registerPlugin(Smarty::PLUGIN_MODIFIER, 'escapeJs', [$escaper, 'escapeJs']);
        $template->registerPlugin(Smarty::PLUGIN_MODIFIER, 'escapeCss', [$escaper, 'escapeCss']);
        $template->registerPlugin(Smarty::PLUGIN_MODIFIER, 'escapeUrl', [$escaper, 'escapeUrl']);

        

    public function __construct(
        Enlight_Components_Cron_Adapter $adapter,
        Enlight_Event_EventManager $eventManager,
        $eventArgsClass = null
    ) {
        $this->setAdapter($adapter);
        $this->setEventManager($eventManager);
        if ($eventArgsClass !== null) {
            $this->eventArgsClass = $eventArgsClass;
        }
    }

    /** * Sets the read / write adapter * * @return Enlight_Components_Cron_Manager */
    public function setAdapter(Enlight_Components_Cron_Adapter $adapter)
    {
Home | Imprint | This part of the site doesn't use cookies.