Base view model for use with Mustache.
The main purpose of this class is to provide the view model with the App instance, thus giving it access to the various helper methods available in that class. Additionally, it provides an instance of Escaper, allowing you to do context-specific escaping within helpers you define in the view model.
category | Phlyty |
---|---|
package | Phlyty |
subpackage | View |
__construct(\Phlyty\App $app, \Zend\Escaper\Escaper $escaper)
Receive and set the App instance as a protected property. If an Escaper instance is passed, it will be assigned; otherwise, an Escaper instance will be instantiated and assigned.
\Phlyty\App
null\Zend\Escaper\Escaper
__escaper() : \Zend\Escaper\Escaper
\Zend\Escaper\Escaper
bindHelper(string $name, callable $helper) : \Phlyty\View\MustacheViewModel
Allows using '$this' within the helper in order to access public properties and methods. Binds the helper to the public property given by $name.
string
\Phlyty\View\callable