PHP Класс Slim\Views\PhpRenderer

Показать файл Открыть проект

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

Свойство Тип Описание
$attributes array
$templatePath string

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

Метод Описание
__construct ( string $templatePath = "", array $attributes = [] ) SlimRenderer constructor.
addAttribute ( $key, $value ) Add an attribute
fetch ( $template, array $data = [] ) : mixed Renders a template and returns the result as a string
getAttribute ( $key ) : mixed Retrieve an attribute
getAttributes ( ) : array Get the attributes for the renderer
getTemplatePath ( ) : string Get the template path
render ( Psr\Http\Message\ResponseInterface $response, string $template, array $data = [] ) : Psr\Http\Message\ResponseInterface Render a template
setAttributes ( array $attributes ) Set the attributes for the renderer
setTemplatePath ( string $templatePath ) Set the template path

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

Метод Описание
protectedIncludeScope ( string $template, array $data )

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

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

SlimRenderer constructor.
public __construct ( string $templatePath = "", array $attributes = [] )
$templatePath string
$attributes array

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

Add an attribute
public addAttribute ( $key, $value )
$key
$value

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

cannot contain template as a key throws RuntimeException if $templatePath . $template does not exist
public fetch ( $template, array $data = [] ) : mixed
$template
$data array
Результат mixed

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

Retrieve an attribute
public getAttribute ( $key ) : mixed
$key
Результат mixed

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

Get the attributes for the renderer
public getAttributes ( ) : array
Результат array

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

Get the template path
public getTemplatePath ( ) : string
Результат string

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

protected protectedIncludeScope ( string $template, array $data )
$template string
$data array

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

$data cannot contain template as a key throws RuntimeException if $templatePath . $template does not exist
public render ( Psr\Http\Message\ResponseInterface $response, string $template, array $data = [] ) : Psr\Http\Message\ResponseInterface
$response Psr\Http\Message\ResponseInterface
$template string
$data array
Результат Psr\Http\Message\ResponseInterface

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

Set the attributes for the renderer
public setAttributes ( array $attributes )
$attributes array

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

Set the template path
public setTemplatePath ( string $templatePath )
$templatePath string

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

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

protected array $attributes
Результат array

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

protected string $templatePath
Результат string