src/View/ViewHelpers.php
public function add(string $name, callable $callback): self
    {
        if ($this->exists($name)) {
            throw new LogicException(
                'The helper function name "' . $name . '" is already registered.'
            );
        }

        $this->helpers[$name] = $callback;

        return $this;
    }
public function add(string $name, callable $callback): self
    {
        if ($this->exists($name)) {
            throw new LogicException(
                'The helper function name "' . $name . '" is already registered.'
            );
        }

        $this->helpers[$name] = $callback;

        return $this;
    }
public function add ( string $ name , callable $ callback ) : self { if ( $ this -> exists ( $ name ) ) { throw new LogicException ( 'The helper function name "' . $ name . '" is already registered.' ) ; } $ this -> helpers [ $ name ] = $ callback ; return $ this ; }
Add a new template function.
@param  string $name
@param  callback $callback
@return ViewHelpers
Add a new template function .