class Edge (View source)

The Edge template engine.

This is a modified version of Laravel Blade engine.

Methods

__construct(EdgeLoaderInterface $loader = null, EdgeCompilerInterface $compiler = null, EdgeCacheInterface $cache = null)

EdgeEnvironment constructor.

string
render(string $__layout, array $__data = array())

render

string
escape(string $string)

escape

void
startSection(string $section, string $content = '')

Start injecting content into a section.

void
inject(string $section, string $content)

Inject inline content into a section.

string
yieldSection()

Stop injecting content into a section and return its contents.

string
stopSection(bool $overwrite = false)

Stop injecting content into a section.

string
appendSection()

Stop injecting content into a section and append it.

string
yieldContent(string $section, string $default = '')

Get the string contents of a section.

void
startPush(string $section, string $content = '')

Start injecting content into a push section.

string
stopPush()

Stop injecting content into a push section.

string
yieldPushContent(string $section, string $default = '')

Get the string contents of a push section.

string
renderEach(string $view, array $data, string $iterator, string $empty = 'raw|')

Get the rendered contents of a partial from a loop.

void
flushSections()

Flush all of the section contents.

void
flushSectionsIfDoneRendering()

Flush all of the section contents if done rendering.

void
incrementRender()

Increment the rendering counter.

void
decrementRender()

Decrement the rendering counter.

bool
doneRendering()

Check if there are no active render operations.

array
arrayExcept(array $array, array $fields)

arrayExcept

array
getGlobals(bool $withExtensions = false)

Method to get property Globals

addGlobal(string $name, string $value)

addGlobal

removeGlobal($name)

No description

getGlobal($name, $default = null)

No description

setGlobals(array $globals)

Method to set property globals

getCompiler()

Method to get property Compiler

setCompiler(EdgeCompilerInterface $compiler)

Method to set property compiler

getLoader()

Method to get property Loader

setLoader(EdgeLoaderInterface $loader)

Method to set property loader

addExtension(EdgeExtensionInterface $extension, string $name = null)

addExtension

removeExtension(string $name)

removeExtension

boolean
hasExtension(string $name)

hasExtension

getExtension(string $name)

getExtension

getExtensions()

Method to get property Extensions

setExtensions(EdgeExtensionInterface[] $extensions)

Method to set property extensions

getCache()

Method to get property Cache

setCache(EdgeCacheInterface $cache)

Method to set property cache

Details

at line line 112
__construct(EdgeLoaderInterface $loader = null, EdgeCompilerInterface $compiler = null, EdgeCacheInterface $cache = null)

EdgeEnvironment constructor.

Parameters

EdgeLoaderInterface $loader
EdgeCompilerInterface $compiler
EdgeCacheInterface $cache

at line line 127
string render(string $__layout, array $__data = array())

render

Parameters

string $__layout
array $__data

Return Value

string

at line line 229
string escape(string $string)

escape

Parameters

string $string

Return Value

string

at line line 242
void startSection(string $section, string $content = '')

Start injecting content into a section.

Parameters

string $section
string $content

Return Value

void

at line line 265
void inject(string $section, string $content)

Inject inline content into a section.

Parameters

string $section
string $content

Return Value

void

at line line 275
string yieldSection()

Stop injecting content into a section and return its contents.

Return Value

string

at line line 293
string stopSection(bool $overwrite = false)

Stop injecting content into a section.

Parameters

bool $overwrite

Return Value

string

Exceptions

InvalidArgumentException

at line line 320
string appendSection()

Stop injecting content into a section and append it.

Return Value

string

Exceptions

InvalidArgumentException

at line line 367
string yieldContent(string $section, string $default = '')

Get the string contents of a section.

Parameters

string $section
string $default

Return Value

string

at line line 391
void startPush(string $section, string $content = '')

Start injecting content into a push section.

Parameters

string $section
string $content

Return Value

void

at line line 412
string stopPush()

Stop injecting content into a push section.

Return Value

string

Exceptions

InvalidArgumentException

at line line 459
string yieldPushContent(string $section, string $default = '')

Get the string contents of a push section.

Parameters

string $section
string $default

Return Value

string

at line line 479
string renderEach(string $view, array $data, string $iterator, string $empty = 'raw|')

Get the rendered contents of a partial from a loop.

Parameters

string $view
array $data
string $iterator
string $empty

Return Value

string

at line line 519
void flushSections()

Flush all of the section contents.

Return Value

void

at line line 535
void flushSectionsIfDoneRendering()

Flush all of the section contents if done rendering.

Return Value

void

at line line 548
void incrementRender()

Increment the rendering counter.

Return Value

void

at line line 558
void decrementRender()

Decrement the rendering counter.

Return Value

void

at line line 568
bool doneRendering()

Check if there are no active render operations.

Return Value

bool

at line line 580
EdgeCompilerInterface prepareExtensions(EdgeCompilerInterface $compiler)

prepareDirectives

Parameters

EdgeCompilerInterface $compiler

Return Value

EdgeCompilerInterface

at line line 606
array arrayExcept(array $array, array $fields)

arrayExcept

Parameters

array $array
array $fields

Return Value

array

at line line 626
array getGlobals(bool $withExtensions = false)

Method to get property Globals

Parameters

bool $withExtensions

Return Value

array

at line line 653
Edge addGlobal(string $name, string $value)

addGlobal

Parameters

string $name
string $value

Return Value

Edge

at line line 660
removeGlobal($name)

Parameters

$name

at line line 667
getGlobal($name, $default = null)

Parameters

$name
$default

at line line 684
Edge setGlobals(array $globals)

Method to set property globals

Parameters

array $globals

Return Value

Edge Return self to support chaining.

at line line 696
EdgeCompilerInterface getCompiler()

Method to get property Compiler

Return Value

EdgeCompilerInterface

at line line 708
Edge setCompiler(EdgeCompilerInterface $compiler)

Method to set property compiler

Parameters

EdgeCompilerInterface $compiler

Return Value

Edge Return self to support chaining.

at line line 720
EdgeLoaderInterface getLoader()

Method to get property Loader

Return Value

EdgeLoaderInterface

at line line 732
Edge setLoader(EdgeLoaderInterface $loader)

Method to set property loader

Parameters

EdgeLoaderInterface $loader

Return Value

Edge Return self to support chaining.

at line line 747
Edge addExtension(EdgeExtensionInterface $extension, string $name = null)

addExtension

Parameters

EdgeExtensionInterface $extension
string $name

Return Value

Edge

at line line 766
Edge removeExtension(string $name)

removeExtension

Parameters

string $name

Return Value

Edge

at line line 783
boolean hasExtension(string $name)

hasExtension

Parameters

string $name

Return Value

boolean

at line line 795
EdgeExtensionInterface getExtension(string $name)

getExtension

Parameters

string $name

Return Value

EdgeExtensionInterface

at line line 810
EdgeExtensionInterface[] getExtensions()

Method to get property Extensions

Return Value

EdgeExtensionInterface[]

at line line 822
Edge setExtensions(EdgeExtensionInterface[] $extensions)

Method to set property extensions

Parameters

EdgeExtensionInterface[] $extensions

Return Value

Edge Return self to support chaining.

at line line 834
EdgeCacheInterface getCache()

Method to get property Cache

Return Value

EdgeCacheInterface

at line line 846
Edge setCache(EdgeCacheInterface $cache)

Method to set property cache

Parameters

EdgeCacheInterface $cache

Return Value

Edge Return self to support chaining.