PHP Класс 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.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$app Phlyty\App
$escaper Zend\Escaper\Escaper

Открытые методы

Метод Описание
__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

Описание методов

__app() публичный Метод

Retrieve application instance
public __app ( ) : App
Результат Phlyty\App

__construct() публичный Метод

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() публичный Метод

Retrieve escaper instance
public __escaper ( ) : Zend\Escaper\Escaper
Результат Zend\Escaper\Escaper

bindHelper() публичный Метод

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
Результат MustacheViewModel

Описание свойств

$app защищенное свойство

protected App,Phlyty $app
Результат Phlyty\App

$escaper защищенное свойство

protected Escaper,Zend\Escaper $escaper
Результат Zend\Escaper\Escaper