Properties

$replaceFunction

$replaceFunction : callable

Type

callable

$recursiveReplaceFunction

$recursiveReplaceFunction : callable

Type

callable

$nonDeepOptions

$nonDeepOptions : array<mixed,string>

Type

array<mixed,string>

$methodTypes

$methodTypes : 

Type

$types

$types : 

Type

$callbacks

$callbacks : array<mixed,callable[]>

Type

array<mixed,callable[]>

$options

$options : \ArrayObject

Type

\ArrayObject

$optionNameHandlers

$optionNameHandlers : array

Type

array

$eventToContainerMap

$eventToContainerMap : null|array

Type

null|array

Methods

getOptions()

getOptions() : array

Returns

array

setOptions()

setOptions(  $options) 

{@inheritdoc}

Parameters

$options

setOptionsRecursive()

setOptionsRecursive(  $options) 

{@inheritdoc}

Parameters

$options

setOptionsDefaults()

setOptionsDefaults(  $options = null) 

{@inheritdoc}

Parameters

$options

hasOption()

hasOption(  $name) 

{@inheritdoc}

Parameters

$name

getOption()

getOption(  $name) 

{@inheritdoc}

Parameters

$name

setOption()

setOption(  $name,   $value) 

{@inheritdoc}

Parameters

$name
$value

unsetOption()

unsetOption(  $name) 

{@inheritdoc}

Parameters

$name

addOptionNameHandlers()

addOptionNameHandlers(callable  $handler) 

Parameters

callable $handler

resetOptions()

resetOptions() 

enable()

enable(\Phug\Renderer|null  $renderer = null) 

Enable a plugin as both an extension and a module either globally or on a given renderer.

Parameters

\Phug\Renderer|null $renderer

Throws

\Phug\PhugException

disable()

disable() 

Globally disable a plugin as both an extension and a module.

Throws

\Phug\PhugException

getEventsList()

getEventsList() : array<mixed,array>

Get events lists to be sorted.

Throws

\ReflectionException

Returns

array<mixed,array>

attachEvent()

attachEvent(string  $event, callable  $callback, integer  $priority) : boolean

Attaches a listener to an event.

Parameters

string $event

the event to attach too

callable $callback

a callable function

integer $priority

the priority at which the $callback executed

Throws

\ReflectionException

Returns

boolean —

true on success false on failure

detachEvent()

detachEvent(string  $event, callable  $callback) : boolean

Detaches a listener from an event.

Parameters

string $event

the event to attach too

callable $callback

a callable function

Throws

\ReflectionException

Returns

boolean —

true on success false on failure

attachEvents()

attachEvents() 

Throws

\ReflectionException

detachEvents()

detachEvents() 

Throws

\ReflectionException

getEvents()

getEvents() : array

Returns

array

getIncludes()

getIncludes() : array

Returns

array

getScanners()

getScanners() : array

Returns

array

getFilters()

getFilters() : array

Returns

array

getKeywords()

getKeywords() : array

Returns

array

getTokenHandlers()

getTokenHandlers() : array

Returns

array

getElementHandlers()

getElementHandlers() : array

Returns

array

getPhpTokenHandlers()

getPhpTokenHandlers() : array

Returns

array

getCompilers()

getCompilers() : array

Returns

array

getFormats()

getFormats() : array

Returns

array

getAssignmentHandlers()

getAssignmentHandlers() : array

Returns

array

getPatterns()

getPatterns() : array

Returns

array

__construct()

__construct(\Phug\Renderer  $renderer) 

Parameters

\Phug\Renderer $renderer

getContainer()

getContainer() 

handleTokenEvent()

handleTokenEvent(\Phug\Lexer\Event\TokenEvent  $tokenEvent) 

Parameters

\Phug\Lexer\Event\TokenEvent $tokenEvent

Throws

\ReflectionException

handleNodeEvent()

handleNodeEvent(\Phug\Compiler\Event\NodeEvent  $nodeEvent) 

Parameters

\Phug\Compiler\Event\NodeEvent $nodeEvent

Throws

\ReflectionException

handleFormatEvent()

handleFormatEvent(\Phug\Formatter\Event\FormatEvent  $formatEvent) 

Parameters

\Phug\Formatter\Event\FormatEvent $formatEvent

Throws

\ReflectionException

getRenderer()

getRenderer() : \Phug\Renderer

Get the current renderer instance (container of the plugin).

Returns

\Phug\Renderer

getCompiler()

getCompiler() : \Phug\CompilerInterface

Get the current compiler instance (used by the renderer).

Returns

\Phug\CompilerInterface

getFormatter()

getFormatter() : \Phug\Formatter

Get the current formatter instance (used by the compiler).

Returns

\Phug\Formatter

getParser()

getParser() : \Phug\Parser

Get the current parser instance (used by the compiler).

Returns

\Phug\Parser

getLexer()

getLexer() : \Phug\Lexer

Get the current lexer instance (used by the parser).

Returns

\Phug\Lexer

getEventContainer()

getEventContainer(string  $event) : \Phug\Util\ModuleContainerInterface

Get the container able to listen the given event.

Parameters

string $event

the event to be listenable

Throws

\ReflectionException

Returns

\Phug\Util\ModuleContainerInterface

addCallback()

addCallback(string  $methodName, callable  $callback) 

Add a callback in the group of the given method name.

Parameters

string $methodName
callable $callback

getCallbacks()

getCallbacks(string  $methodName) : array<mixed,callable>

Get callbacks for a given method name.

Parameters

string $methodName

if you pass a name including the class (such as MyClass::myMethod), then class name is ignored.

Returns

array<mixed,callable>

getTokenGenerator()

getTokenGenerator(array<mixed,callable>  $callbacks, \Phug\Partial\iterable  $tokens) : \Phug\Partial\iterable

Get a iterable list of output tokens from a list of interceptors and input tokens.

Parameters

array<mixed,callable> $callbacks

list of callable interceptors

\Phug\Partial\iterable $tokens

input tokens

Throws

\Exception
\ReflectionException

Returns

\Phug\Partial\iterable

getClassForEvents()

getClassForEvents() : \Phug\iterable|array<mixed,string>

Throws

\ReflectionException

Returns

\Phug\iterable|array<mixed,string>

getEventToContainerMap()

getEventToContainerMap() : array

Throws

\ReflectionException

Returns

array

getMethodsByPrefix()

getMethodsByPrefix(  $prefix) 

Parameters

$prefix

addSpecificCallback()

addSpecificCallback(  $methods,   $type,   $callback) 

Parameters

$methods
$type
$callback

handleOptionName()

handleOptionName(string  $name) : string

Parameters

string $name

Returns

string

filterTraversable()

filterTraversable(  $values) 

Parameters

$values

setOptionArrays()

setOptionArrays(array  $arrays, string  $functionName) : $this

Parameters

array $arrays
string $functionName

Returns

$this

mergeOptionValue()

mergeOptionValue(  $name,   $current,   $addedValue,   $functionName) 

Parameters

$name
$current
$addedValue
$functionName

setDefaultOption()

setDefaultOption(  $key,   $value) 

Parameters

$key
$value

withVariableReference()

withVariableReference(mixed  $variable,   $name, callable  $callback) : \Phug\Util\Partial\&$options

Parameters

mixed $variable
$name
callable $callback

Returns

\Phug\Util\Partial\&$options

withOptionReference()

withOptionReference(  $name, callable  $callback) : \Phug\Util\Partial\&$options

Parameters

$name
callable $callback

Returns

\Phug\Util\Partial\&$options

activateOnRenderer()

activateOnRenderer(\Phug\Renderer  $renderer) 

Parameters

\Phug\Renderer $renderer

toArrayIfTruthy()

toArrayIfTruthy(  $value) 

Parameters

$value