芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/lib/classes/output/mustache_engine.php
. /** * Custom Moodle engine for mustache. * * @copyright 2019 Ryan Wyllie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core\output; /** * Custom Moodle engine for mustache. * * @copyright 2019 Ryan Wyllie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class mustache_engine extends \Mustache_Engine { /** * @var mustache_helper_collection */ private $helpers; /** * @var string[] Names of helpers that aren't allowed to be called within other helpers. */ private $blacklistednestedhelpers = []; /** * Mustache engine constructor. * * This provides an additional option to the parent \Mustache_Engine implementation: * $options = [ * // A list of helpers (by name) to prevent from executing within the rendering * // of other helpers. * 'blacklistednestedhelpers' => ['js'] * ]; * @param array $options [description] */ public function __construct(array $options = []) { if (isset($options['blacklistednestedhelpers'])) { $this->blacklistednestedhelpers = $options['blacklistednestedhelpers']; } parent::__construct($options); } /** * Get the current set of Mustache helpers. * * @see Mustache_Engine::setHelpers * * @return \Mustache_HelperCollection */ public function getHelpers() { if (!isset($this->helpers)) { $this->helpers = new mustache_helper_collection(null, $this->blacklistednestedhelpers); } return $this->helpers; } }