PHP Класс core\Template

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

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

Метод Описание
getContext ( )
getPath ( string $templateName ) : string Get template file path
getView ( )
load ( string $templateName, array $context = [] ) : string Load a template from data folder, compile it if it is outdated or not exists
parseLoop ( $match )
parseUrlRewrite ( $match )
putContext ( $name, $value, $escapeType = Escape::TEXT_RECURSIVE )
render ( )
setContext ( $context = [] )
setView ( $viewName )

Приватные методы

Метод Описание
compile ( $templateName )
createDir ( $dir, $permission = 511 )
pregGet ( $subject, $pattern, $offset = 1 )

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

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

public static getContext ( )

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

Get template file path
public static getPath ( string $templateName ) : string
$templateName string Template file name
Результат string Absolute path of the template file

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

public static getView ( )

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

Load a template from data folder, compile it if it is outdated or not exists
Устаревший: Please use setView(), putContext(), render()
public static load ( string $templateName, array $context = [] ) : string
$templateName string
$context array
Результат string

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

public static parseLoop ( $match )

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

public static parseUrlRewrite ( $match )

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

public static putContext ( $name, $value, $escapeType = Escape::TEXT_RECURSIVE )

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

public static render ( )

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

public static setContext ( $context = [] )

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

public static setView ( $viewName )