\Phug\RendererAdapterInterface

An adapter provides a way to return/output the rendered code.

Summary

Methods
Constants
hasOption()
getOption()
setOption()
getOptions()
setOptions()
setOptionsRecursive()
setOptionsDefaults()
unsetOption()
__construct()
getRenderer()
captureBuffer()
render()
display()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

hasOption()

hasOption(string|array  $name) : mixed

Parameters

string|array $name

Returns

mixed

getOption()

getOption(string|array  $name) : mixed

Parameters

string|array $name

Returns

mixed

setOption()

setOption(string|array  $name, mixed  $value) : $this

Parameters

string|array $name
mixed $value

Returns

$this

getOptions()

getOptions() : array|\ArrayAccess

Returns

array|\ArrayAccess

setOptions()

setOptions(array|\ArrayAccess  $options) : $this

Parameters

array|\ArrayAccess $options

Returns

$this

setOptionsRecursive()

setOptionsRecursive(array|\ArrayAccess  $options) : $this

Parameters

array|\ArrayAccess $options

Returns

$this

setOptionsDefaults()

setOptionsDefaults(array  $options) : $this

Parameters

array $options

Returns

$this

unsetOption()

unsetOption(string|array  $name) : $this

Parameters

string|array $name

Returns

$this

__construct()

__construct(\Phug\Renderer  $renderer, array|\ArrayObject  $options) 

Parameters

\Phug\Renderer $renderer
array|\ArrayObject $options

getRenderer()

getRenderer() : \Phug\Renderer

Return the renderer the adapter was constructed with.

Returns

\Phug\Renderer

captureBuffer()

captureBuffer(callable  $display) : mixed

Capture buffered output of a callable display action.

Parameters

callable $display

the action that potentially send output to the buffer.

Throws

\Throwable

Returns

mixed

render()

render(string  $php, array  $parameters) : string

Return renderer HTML.

Parameters

string $php

PHP source code

array $parameters

variables names and values

Returns

string

display()

display(string  $php, array  $parameters) 

Display renderer HTML.

Parameters

string $php

PHP source code

array $parameters

variables names and values