PHP Класс PMA\libraries\Template

Handle front end templating
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$data Data associated with the template
$helperFunctions Helper functions for the template
$name Name of the template

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

Метод Описание
__call ( string $funcName, array $arguments ) Magic call to locally inaccessible but associated helper functions
get ( string $name, array $data = [], array $helperFunctions = [] ) : Template Template getter
removeHelper ( string $funcName ) Removes a function
render ( array $data = [], array $helperFunctions = [] ) : string Render template
set ( array | string $data, string $value = null ) Adds more entries to the data for this template
setHelper ( string $funcName, callable $funcDef ) Adds a function for use by the template

Защищенные методы

Метод Описание
__construct ( string $name, array $data = [], array $helperFunctions = [] ) Template constructor

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

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

Magic call to locally inaccessible but associated helper functions
public __call ( string $funcName, array $arguments )
$funcName string function name
$arguments array function arguments

__construct() защищенный Метод

Template constructor
protected __construct ( string $name, array $data = [], array $helperFunctions = [] )
$name string Template name
$data array Variables to be provided to the template
$helperFunctions array Helper functions to be used by template

get() публичный статический Метод

Template getter
public static get ( string $name, array $data = [], array $helperFunctions = [] ) : Template
$name string Template name
$data array Variables to be provided to the template
$helperFunctions array Helper functions to be used by template
Результат Template

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

Removes a function
public removeHelper ( string $funcName )
$funcName string function name

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

Render template
public render ( array $data = [], array $helperFunctions = [] ) : string
$data array Variables to be provided to the template
$helperFunctions array Helper functions to be used by template
Результат string

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

Adds more entries to the data for this template
public set ( array | string $data, string $value = null )
$data array | string containing data array or data key
$value string containing data value

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

Adds a function for use by the template
public setHelper ( string $funcName, callable $funcDef )
$funcName string function name
$funcDef callable function definition

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

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

Data associated with the template
protected $data

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

Helper functions for the template
protected $helperFunctions

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

Name of the template
protected $name