Registers helpers accessible by any template in the environment
@param string|array|object $name
@param string|callable|bool $helper
1179
public function registerHelper($name, $helper = false)
    {
        if (is_array($name)) {
            foreach ($name as $n => $helper) {
                $this->registerHelper($n, $helper);
            }
        } elseif (is_object($name)) {
            $this->registerJavascriptObject('helper', $this->wrapHelperObject($name));
        } elseif ($helper === false) {
            $this->registerJavascriptObject('helper', $name);
        } elseif (is_callable($helper)) {
            $this->registerJavascriptFunction('helper', $name, $this->wrapHelperCallable($name, $helper));
        } else {
            $this->registerJavascriptFunction('helper', $name, $helper);
        }
    }
18312
public static function unregisterHelper($name)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');

        if (isset(self::$helpers[$name])) {
            unset(self::$helpers[$name]);
        }
    }
952378
public static function registerModule(string $name): void
    {
        if (!isset(static::$registeredModules[$name])) {
            $modulePath = static::getModulePath($name);

            static::prependIncludePath($modulePath . 'controllers', $modulePath . 'library');
            static::$registeredModules[$name] = true;
            $initPath = $modulePath . 'init.php';

            if (is_file($initPath)) {
                require $initPath;
            }
        }
    }
224665
public function addMatcher($name, $matcher)
    {
        if (is_callable($matcher)) {
            $this->matchers[$name] = $matcher;
        }

        return $this;
    }
957034
private function enablePragma($name)
    {
        $this->pragmas[$name] = true;

        switch ($name) {
            case Mustache_Engine::PRAGMA_BLOCKS:
                $this->pragmaBlocks = true;
                break;

            case Mustache_Engine::PRAGMA_FILTERS:
                $this->pragmaFilters = true;
                break;
        }
    }
836225
protected function addHeader(string $name, string $value): void
    {
        $this->headers->add($name, $value);
    }
1232615
public function register_block($name, $callback, $cacheable = true, $cache_attrs = null)
    {
        if (isset($this->plugins[$name]) && $this->plugins[$name][0] !== self::SMARTY_BLOCK) {
            throw new Exception('Multiple plugins of different types can not share the same name');
        }
        $this->plugins[$name] = array(
            'type'     => self::SMARTY_BLOCK,
            'callback' => $callback
        );
    }
870714
public function registerHelper($name, $provider)
    {
        $this->formatter->getDependencies()->register(
            $this->helperName($name),
            $provider
        );

        return $this;
    }
1164855
private function add_helpers( $helpers ) {
		foreach( $helpers as $helper ) {
			$helper = $this->validate_helper_input( $helper );
			if ( is_array( $helper ) ) {
				$this->add_helper( $helper );
			}

		}

	}
1296386
public function register_handler($name, $owner, $callback)
    {
        // check name
        if (strpos($name, 'plugin.') !== 0) {
            $name = 'plugin.' . $name;
        }

        // can register handler only if it's not taken or registered by myself
        if (is_object($this->output)
            && (!isset($this->objectsmap[$name]) || $this->objectsmap[$name] == $owner)
        ) {
            $this->output->add_handler($name, $callback);
            $this->objectsmap[$name] = $owner;
        }
        else {
            rcube::raise_error(array('code' => 525, 'type' => 'php',
                'file' => __FILE__, 'line' => __LINE__,
                'message' => "Cannot register template handler $name;"
                    ." already taken by another plugin or no output object available"), true, false);
        }
    }
199482
public function disable($name)
    {
        $enabled = $this->getEnabled();

        if (($k = array_search($name, $enabled)) === false) {
            return;
        }

        $extension = $this->getExtension($name);

        $this->dispatcher->dispatch(new Disabling($extension));

        unset($enabled[$k]);

        $this->setEnabled($enabled);

        $extension->disable($this->app);

        $this->dispatcher->dispatch(new Disabled($extension));
    }
856825
public function registerCall($name, array $arguments = [])
    {
        $name = strtolower(preg_replace("/([A-Z]{1})/", "_$0", $name));

        $this->calls = array_merge($this->calls, array_filter(explode("_", $name)));

        if (count($arguments) > 0) {
            $lastIndex = count($this->calls) - 1;

            $this->calls[$lastIndex] = [$this->calls[$lastIndex], $arguments];
        }
    }
142781
public function buildValidator(Event $event, Validator $validator, string $name): void
    {
        $this->validationStrictPassword($validator);
    }
13161
public function AddHeader($name, $enabled=true)
    {
        if(!isset($this->headers[$name]))
        {
            $header = new Element\Header($name, $enabled);

            $this->headers[$name] = $header;
        }
    }
196518
protected function getHelper($helper, $params=array())
    {
        if ($this->isLibraryHelper($helper)) $this->_helperClassName = $this->_libNamespace . $helper;
        else if ($this->isApplicationHelper($helper)) $this->_helperClassName = $this->_appNamespace . $helper;
        else throw new HelperNotFoundException('The helper ' . $helper . ' does not exist');

        $this->_helperParams = $params;
    }
421019
public function getHelper($name)
    {
        if (empty($this->helpers[$name])) {
            return null;
        }

        return $this->helpers[$name];
    }
232611
public function register($name, $handler)
    {
        Assert::string($name, 'The handler name must be a string. Got: %s');
        Assert::notEmpty($name, 'The handler name must not be empty.');

        if (!is_object($handler)) {
            Assert::isCallable($handler, 'The handler must be a callable or an object. Got: %s');
        }

        $this->handlers[$name] = $handler;

        if (!$this->selectedHandler) {
            $this->selectedHandler = $name;
        }
    }