Properties

$openPhpTag

$openPhpTag : 

Type

$closePhpTag

$closePhpTag : 

Type

$name

$name : 

Type

$target

$target : 

Type

$params

$params : 

Type

$propagationStopped

$propagationStopped : 

Type

$compileEvent

$compileEvent : 

Type

$output

$output : 

Type

Methods

__construct()

__construct(\Phug\Compiler\Event\CompileEvent  $compileEvent, string  $output) 

OutputEvent constructor.

Parameters

\Phug\Compiler\Event\CompileEvent $compileEvent
string $output

getName()

getName() : string

Get event name.

Returns

string

getTarget()

getTarget() : null|string|object

Get target/context from which event was triggered.

Returns

null|string|object

getParams()

getParams() : array

Get parameters passed to the event.

Returns

array

getParam()

getParam(string  $name) : mixed

Get a single parameter by name.

Parameters

string $name

Returns

mixed

setName()

setName(string  $name) : void

Set the event name.

Parameters

string $name

setTarget()

setTarget(null|string|object  $target) : void

Set the event target.

Parameters

null|string|object $target

setParams()

setParams(array  $params) : void

Set event parameters.

Parameters

array $params

stopPropagation()

stopPropagation(boolean  $flag) 

Indicate whether or not to stop propagating this event.

Parameters

boolean $flag

isPropagationStopped()

isPropagationStopped() : boolean

Has this event indicated event propagation should stop?

Returns

boolean

getOutput()

getOutput() : string

Returns

string

setOutput()

setOutput(string  $output) 

Parameters

string $output

prependCode()

prependCode(string  $code) 

Prepend PHP code before the output (but after the namespace statement if present).

Parameters

string $code

PHP code (without <?php ?> tags).

prependOutput()

prependOutput(string  $code) 

Prepend output (HTML code or PHP code with <?php ?> tags) before the output (but after the namespace statement if present).

Parameters

string $code

HTML code or PHP code with <?php ?> tags.

hasNamespaceStatement()

hasNamespaceStatement(string  $namespaceStatement = '', string  $afterCode = '') : boolean

Check if the output contains a namespace statement at the beginning.

Parameters

string $namespaceStatement

Variable passed by reference that receives the namespace statement if present, or an empty string else.

string $afterCode

Variable passed by reference that receives the rest of the output (all the output if no namespace statement present).

Returns

boolean —

true if a namespace statement if present, false else.

openPhpCode()

openPhpCode(  $code) 

Parameters

$code

closePhpCode()

closePhpCode(  $code) 

Parameters

$code

concatCode()

concatCode()