Methods

hasModule()

hasModule(  $className) 

Parameters

$className

getModule()

getModule(  $className) 

Parameters

$className

getModules()

getModules() 

getStaticModules()

getStaticModules() 

addModule()

addModule(  $className) 

Parameters

$className

addModules()

addModules(array  $classNames) 

Parameters

array $classNames

removeModule()

removeModule(  $className) 

Parameters

$className

getModuleBaseClassName()

getModuleBaseClassName() 

getEventListeners()

getEventListeners() : array<mixed,\Phug\Event\ListenerQueue>

Returns current event listeners by event name.

Returns

array<mixed,\Phug\Event\ListenerQueue>

mergeEventListeners()

mergeEventListeners(array<mixed,\Phug\Event\ListenerQueue>  $eventListeners) : boolean

Merge current events listeners with a given list.

Parameters

array<mixed,\Phug\Event\ListenerQueue> $eventListeners

event listeners by event name

Returns

boolean —

true on success false on failure

attach()

attach(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

Returns

boolean —

true on success false on failure

detach()

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

Detaches a listener from an event.

Parameters

string $event

the event to attach too

callable $callback

a callable function

Returns

boolean —

true on success false on failure

clearListeners()

clearListeners(string  $event) : void

Clear all listeners for a given event.

Parameters

string $event

trigger()

trigger(string|\Phug\EventInterface  $event, object|string  $target = null, array|object  $argv = array()) : mixed

Trigger an event.

Can accept an EventInterface or will create one if not passed

Parameters

string|\Phug\EventInterface $event
object|string $target
array|object $argv

Returns

mixed

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

Returns

array

setOptions()

setOptions(array  $options) : $this

Parameters

array $options

Returns

$this

setOptionsRecursive()

setOptionsRecursive(array  $options) : $this

Parameters

array $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

getParser()

getParser() : \Phug\Parser

Returns

\Phug\Parser

setLayout()

setLayout(\Phug\Compiler\Layout  $layout) : mixed

Parameters

\Phug\Compiler\Layout $layout

Returns

mixed

setParentCompiler()

setParentCompiler(self  $compiler) : $this

Parameters

self $compiler

Returns

$this

locate()

locate(  $path, null  $paths = null) : mixed

Parameters

$path
null $paths

Returns

mixed

resolve()

resolve(  $path, null  $paths = null) : mixed

Parameters

$path
null $paths

Returns

mixed

getFileContents()

getFileContents(  $path) : mixed

Parameters

$path

Returns

mixed

getBlocksByName()

getBlocksByName(string  $name) : array

Parameters

string $name

Returns

array

getBlocks()

getBlocks() : array

Returns

array

compileBlocks()

compileBlocks() : $this

Throws

\Phug\CompilerException

Returns

$this

importBlocks()

importBlocks(array  $blocks) : $this

Parameters

array $blocks

Returns

$this

registerImportPath()

registerImportPath(  $path) : $this

Parameters

$path

Returns

$this

getImportPaths()

getImportPaths(string|null  $path = null) : array

Parameters

string|null $path

Returns

array

getCurrentImportPaths()

getCurrentImportPaths() : array

Returns

array

compile()

compile(string  $input, string  $path = null) : string

Parameters

string $input
string $path

Returns

string

compileFile()

compileFile(string  $path) : string

Parameters

string $path

Returns

string

compileIntoElement()

compileIntoElement(string  $input, string  $path = null) : null|\Phug\Formatter\ElementInterface

Parameters

string $input
string $path

Returns

null|\Phug\Formatter\ElementInterface

compileDocument()

compileDocument(string  $input, string  $path = null) : null|\Phug\Formatter\ElementInterface

Parameters

string $input

pug input

string $path

optional path of the compiled source

Throws

\Phug\CompilerException

Returns

null|\Phug\Formatter\ElementInterface

compileFileIntoElement()

compileFileIntoElement(string  $path) : null|\Phug\Formatter\ElementInterface

Parameters

string $path

Returns

null|\Phug\Formatter\ElementInterface

getPath()

getPath() : null|string

Returns

null|string

setImportNode()

setImportNode(\Phug\Parser\NodeInterface  $defaultYieldChildren) : $this

Parameters

\Phug\Parser\NodeInterface $defaultYieldChildren

Returns

$this

setYieldNode()

setYieldNode(\Phug\Parser\NodeInterface  $yieldNode) : $this

Parameters

\Phug\Parser\NodeInterface $yieldNode

Returns

$this

unsetYieldNode()

unsetYieldNode() : $this

Returns

$this

isImportNodeYielded()

isImportNodeYielded() : boolean

Returns

boolean

dump()

dump(string  $input, string  $path = null) : string

Parameters

string $input

pug input

string $path

optional path of the compiled source

Returns

string

dumpFile()

dumpFile(string  $path) : string

Parameters

string $path

pug input file

Returns

string

getFilter()

getFilter(string  $name) : callable|null

Parameters

string $name

Returns

callable|null

hasFilter()

hasFilter(string  $name) : boolean

Parameters

string $name

Returns

boolean

setFilter()

setFilter(string  $name, callable  $filter) : $this

Parameters

string $name
callable $filter

Returns

$this

unsetFilter()

unsetFilter(string  $name) : $this

Parameters

string $name

Returns

$this

throwException()

throwException(string  $message, \Phug\Parser\NodeInterface  $node = null, integer  $code, \Throwable  $previous = null) 

Parameters

string $message

A meaningful error message

\Phug\Parser\NodeInterface $node

Node generating the error

integer $code

Error code

\Throwable $previous

Source error

Throws

\Phug\CompilerException

assert()

assert(boolean  $condition, string  $message, \Phug\Parser\NodeInterface  $node = null, integer  $code, \Throwable  $previous = null) 

Parameters

boolean $condition

Assertion to verify

string $message

Error message to throw if assertion fails

\Phug\Parser\NodeInterface $node

Node generating the error

integer $code

Error code

\Throwable $previous

Source error

Throws

\Phug\CompilerException