Actions

GetPluginTwigPath

From LimeSurvey Manual

Notice.png
 Hint: This features is available starting in version 3.10.0


Usage

This event allow plugin to add directory inside twig system. This directory can be read at start : allowing to replace any template twig file or at end to add new twig file.

Input

Nothing

Possible output

  • add : array of new directory readed after all template twig file
  • replace : array of new directory readed before all template twig file

usage

    public function getPluginTwigPath()
    {
        $viewPath = dirname(__FILE__)."/views"; // All twig file inside this directory (and subdirectory) can be used in any template
        $forcedPath = dirname(__FILE__)."/forced"; // All twig file inside this directory  (and subdirectory)  are used in any template
        $this->getEvent()->append('add', array($viewPath));
        $this->getEvent()->append('replace', array($forcedPath));
    }

Sample