Enlight_Event_Handler_Plugin example


    public function subscribeEvent($event$listener$position = null)
    {
        $namespace = $this->Collection();
        $handler = new Enlight_Event_Handler_Plugin(
            $event$namespace$this$listener$position
        );
        $namespace->Subscriber()->registerListener($handler);

        return $this;
    }

    /** * This function installs the plugin. * * @return bool */

    public function read()
    {
        $this->listeners = [];

        if ($this->storage->listeners !== null) {
            foreach ($this->storage->listeners as $entry) {
                if (!$entry instanceof Enlight_Config) {
                    continue;
                }
                $this->listeners[] = new Enlight_Event_Handler_Plugin(
                    $entry->name,
                    $this->namespace,
                    $entry->plugin,
                    $entry->listener,
                    $entry->position
                );
            }
        }

        return $this;
    }

    
Home | Imprint | This part of the site doesn't use cookies.