PHP 클래스 Slim\Views\PhpRenderer

파일 보기 프로젝트 열기: geggleto/slim-renderer

보호된 프로퍼티들

프로퍼티 타입 설명
$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