Phlyty\View\MustacheViewModel::bindHelper PHP Method

bindHelper() public method

Allows using '$this' within the helper in order to access public properties and methods. Binds the helper to the public property given by $name.
public bindHelper ( string $name, callable $helper ) : MustacheViewModel
$name string
$helper callable
return MustacheViewModel
    public function bindHelper($name, callable $helper)
    {
        $helper = Closure::bind($helper, $this);
        $this->{$name} = $helper;
        return $this;
    }