PHP Class Phlyty\View\MustacheViewModel

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.
Afficher le fichier Open project: phly/phlyty Class Usage Examples

Protected Properties

Свойство Type Description
$app Phlyty\App
$escaper Zend\Escaper\Escaper

Méthodes publiques

Méthode Description
__app ( ) : App Retrieve application instance
__construct ( App $app, Zend\Escaper\Escaper $escaper = null ) Constructor
__escaper ( ) : Zend\Escaper\Escaper Retrieve escaper instance
bindHelper ( string $name, callable $helper ) : MustacheViewModel Bind a helper within the view model object's context

Method Details

__app() public méthode

Retrieve application instance
public __app ( ) : App
Résultat Phlyty\App

__construct() public méthode

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.
public __construct ( App $app, Zend\Escaper\Escaper $escaper = null )
$app Phlyty\App
$escaper Zend\Escaper\Escaper

__escaper() public méthode

Retrieve escaper instance
public __escaper ( ) : Zend\Escaper\Escaper
Résultat Zend\Escaper\Escaper

bindHelper() public méthode

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
Résultat MustacheViewModel

Property Details

$app protected_oe property

protected App,Phlyty $app
Résultat Phlyty\App

$escaper protected_oe property

protected Escaper,Zend\Escaper $escaper
Résultat Zend\Escaper\Escaper