PHP Класс Xiaoler\Blade\Factory

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$aliases array Array of registered view name aliases.
$engine Xiaoler\Blade\Engines\EngineInterface The engine implementation.
$finder Xiaoler\Blade\ViewFinderInterface The view finder implementation.
$loopsStack array The stack of in-progress loops.
$names array All of the registered view names.
$pushStack array The stack of in-progress push sections.
$pushes array All of the finished, captured push sections.
$renderCount integer The number of active rendering operations.
$sectionStack array The stack of in-progress sections.
$sections array All of the finished, captured sections.
$shared array Data that should be available to all templates.

Открытые методы

Метод Описание
__construct ( Xiaoler\Blade\Engines\EngineInterface $engine, Xiaoler\Blade\ViewFinderInterface $finder ) : void Create a new view factory instance.
addLocation ( string $location ) : void Add a location to the array of view locations.
addLoop ( array | Countable $data ) : void Add new loop to the stack.
addNamespace ( string $namespace, string | array $hints ) : void Add a new namespace to the loader.
alias ( string $view, string $alias ) : void Add an alias for a view.
appendSection ( ) : string Stop injecting content into a section and append it.
decrementRender ( ) : void Decrement the rendering counter.
doneRendering ( ) : boolean Check if there are no active render operations.
exists ( string $view ) : boolean Determine if a given view exists.
file ( string $path, array $data = [], array $mergeData = [] ) : Xiaoler\Blade\View Get the evaluated view contents for the given view.
flushSections ( ) : void Flush all of the section contents.
flushSectionsIfDoneRendering ( ) : void Flush all of the section contents if done rendering.
getFinder ( ) : Xiaoler\Blade\ViewFinderInterface Get the view finder instance.
getFirstLoop ( ) : array Get an instance of the first loop in the stack.
getLoopStack ( ) : array Get the entire loop stack.
getNames ( ) : array Get all of the registered named views in environment.
getSections ( ) : array Get the entire array of sections.
getShared ( ) : array Get all of the shared data for the environment.
hasSection ( string $name ) : boolean Check if section exists.
incrementLoopIndices ( ) : void Increment the top loop's indices.
incrementRender ( ) : void Increment the rendering counter.
inject ( string $section, string $content ) : void Inject inline content into a section.
make ( string $view, array $data = [], array $mergeData = [] ) : Xiaoler\Blade\View Get the evaluated view contents for the given view.
name ( string $view, string $name ) : void Register a named view.
of ( string $view, mixed $data = [] ) : Xiaoler\Blade\View Get the evaluated view contents for a named view.
popLoop ( ) : void Pop a loop from the top of the loop stack.
prependNamespace ( string $namespace, string | array $hints ) : void Prepend a new namespace to the loader.
renderEach ( string $view, array $data, string $iterator, string $empty = 'raw|' ) : string Get the rendered contents of a partial from a loop.
setFinder ( Xiaoler\Blade\ViewFinderInterface $finder ) : void Set the view finder instance.
share ( array | string $key, mixed $value = null ) : mixed Add a piece of shared data to the environment.
shared ( string $key, mixed $default = null ) : mixed Get an item from the shared data.
startPush ( string $section, string $content = '' ) : void Start injecting content into a push section.
startSection ( string $section, string $content = '' ) : void Start injecting content into a section.
stopPush ( ) : string Stop injecting content into a push section.
stopSection ( boolean $overwrite = false ) : string Stop injecting content into a section.
yieldContent ( string $section, string $default = '' ) : string Get the string contents of a section.
yieldPushContent ( string $section, string $default = '' ) : string Get the string contents of a push section.
yieldSection ( ) : string Stop injecting content into a section and return its contents.

Защищенные методы

Метод Описание
extendPush ( string $section, string $content ) : void Append content to a given push section.
extendSection ( string $section, string $content ) : void Append content to a given section.
normalizeName ( string $name ) : string Normalize a view name.

Описание методов

__construct() публичный Метод

Create a new view factory instance.
public __construct ( Xiaoler\Blade\Engines\EngineInterface $engine, Xiaoler\Blade\ViewFinderInterface $finder ) : void
$engine Xiaoler\Blade\Engines\EngineInterface
$finder Xiaoler\Blade\ViewFinderInterface
Результат void

addLocation() публичный Метод

Add a location to the array of view locations.
public addLocation ( string $location ) : void
$location string
Результат void

addLoop() публичный Метод

Add new loop to the stack.
public addLoop ( array | Countable $data ) : void
$data array | Countable
Результат void

addNamespace() публичный Метод

Add a new namespace to the loader.
public addNamespace ( string $namespace, string | array $hints ) : void
$namespace string
$hints string | array
Результат void

alias() публичный Метод

Add an alias for a view.
public alias ( string $view, string $alias ) : void
$view string
$alias string
Результат void

appendSection() публичный Метод

Stop injecting content into a section and append it.
public appendSection ( ) : string
Результат string

decrementRender() публичный Метод

Decrement the rendering counter.
public decrementRender ( ) : void
Результат void

doneRendering() публичный Метод

Check if there are no active render operations.
public doneRendering ( ) : boolean
Результат boolean

exists() публичный Метод

Determine if a given view exists.
public exists ( string $view ) : boolean
$view string
Результат boolean

extendPush() защищенный Метод

Append content to a given push section.
protected extendPush ( string $section, string $content ) : void
$section string
$content string
Результат void

extendSection() защищенный Метод

Append content to a given section.
protected extendSection ( string $section, string $content ) : void
$section string
$content string
Результат void

file() публичный Метод

Get the evaluated view contents for the given view.
public file ( string $path, array $data = [], array $mergeData = [] ) : Xiaoler\Blade\View
$path string
$data array
$mergeData array
Результат Xiaoler\Blade\View

flushSections() публичный Метод

Flush all of the section contents.
public flushSections ( ) : void
Результат void

flushSectionsIfDoneRendering() публичный Метод

Flush all of the section contents if done rendering.
public flushSectionsIfDoneRendering ( ) : void
Результат void

getFinder() публичный Метод

Get the view finder instance.
public getFinder ( ) : Xiaoler\Blade\ViewFinderInterface
Результат Xiaoler\Blade\ViewFinderInterface

getFirstLoop() публичный Метод

Get an instance of the first loop in the stack.
public getFirstLoop ( ) : array
Результат array

getLoopStack() публичный Метод

Get the entire loop stack.
public getLoopStack ( ) : array
Результат array

getNames() публичный Метод

Get all of the registered named views in environment.
public getNames ( ) : array
Результат array

getSections() публичный Метод

Get the entire array of sections.
public getSections ( ) : array
Результат array

getShared() публичный Метод

Get all of the shared data for the environment.
public getShared ( ) : array
Результат array

hasSection() публичный Метод

Check if section exists.
public hasSection ( string $name ) : boolean
$name string
Результат boolean

incrementLoopIndices() публичный Метод

Increment the top loop's indices.
public incrementLoopIndices ( ) : void
Результат void

incrementRender() публичный Метод

Increment the rendering counter.
public incrementRender ( ) : void
Результат void

inject() публичный Метод

Inject inline content into a section.
public inject ( string $section, string $content ) : void
$section string
$content string
Результат void

make() публичный Метод

Get the evaluated view contents for the given view.
public make ( string $view, array $data = [], array $mergeData = [] ) : Xiaoler\Blade\View
$view string
$data array
$mergeData array
Результат Xiaoler\Blade\View

name() публичный Метод

Register a named view.
public name ( string $view, string $name ) : void
$view string
$name string
Результат void

normalizeName() защищенный Метод

Normalize a view name.
protected normalizeName ( string $name ) : string
$name string
Результат string

of() публичный Метод

Get the evaluated view contents for a named view.
public of ( string $view, mixed $data = [] ) : Xiaoler\Blade\View
$view string
$data mixed
Результат Xiaoler\Blade\View

popLoop() публичный Метод

Pop a loop from the top of the loop stack.
public popLoop ( ) : void
Результат void

prependNamespace() публичный Метод

Prepend a new namespace to the loader.
public prependNamespace ( string $namespace, string | array $hints ) : void
$namespace string
$hints string | array
Результат void

renderEach() публичный Метод

Get the rendered contents of a partial from a loop.
public renderEach ( string $view, array $data, string $iterator, string $empty = 'raw|' ) : string
$view string
$data array
$iterator string
$empty string
Результат string

setFinder() публичный Метод

Set the view finder instance.
public setFinder ( Xiaoler\Blade\ViewFinderInterface $finder ) : void
$finder Xiaoler\Blade\ViewFinderInterface
Результат void

share() публичный Метод

Add a piece of shared data to the environment.
public share ( array | string $key, mixed $value = null ) : mixed
$key array | string
$value mixed
Результат mixed

shared() публичный Метод

Get an item from the shared data.
public shared ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
Результат mixed

startPush() публичный Метод

Start injecting content into a push section.
public startPush ( string $section, string $content = '' ) : void
$section string
$content string
Результат void

startSection() публичный Метод

Start injecting content into a section.
public startSection ( string $section, string $content = '' ) : void
$section string
$content string
Результат void

stopPush() публичный Метод

Stop injecting content into a push section.
public stopPush ( ) : string
Результат string

stopSection() публичный Метод

Stop injecting content into a section.
public stopSection ( boolean $overwrite = false ) : string
$overwrite boolean
Результат string

yieldContent() публичный Метод

Get the string contents of a section.
public yieldContent ( string $section, string $default = '' ) : string
$section string
$default string
Результат string

yieldPushContent() публичный Метод

Get the string contents of a push section.
public yieldPushContent ( string $section, string $default = '' ) : string
$section string
$default string
Результат string

yieldSection() публичный Метод

Stop injecting content into a section and return its contents.
public yieldSection ( ) : string
Результат string

Описание свойств

$aliases защищенное свойство

Array of registered view name aliases.
protected array $aliases
Результат array

$engine защищенное свойство

The engine implementation.
protected EngineInterface,Xiaoler\Blade\Engines $engine
Результат Xiaoler\Blade\Engines\EngineInterface

$finder защищенное свойство

The view finder implementation.
protected ViewFinderInterface,Xiaoler\Blade $finder
Результат Xiaoler\Blade\ViewFinderInterface

$loopsStack защищенное свойство

The stack of in-progress loops.
protected array $loopsStack
Результат array

$names защищенное свойство

All of the registered view names.
protected array $names
Результат array

$pushStack защищенное свойство

The stack of in-progress push sections.
protected array $pushStack
Результат array

$pushes защищенное свойство

All of the finished, captured push sections.
protected array $pushes
Результат array

$renderCount защищенное свойство

The number of active rendering operations.
protected int $renderCount
Результат integer

$sectionStack защищенное свойство

The stack of in-progress sections.
protected array $sectionStack
Результат array

$sections защищенное свойство

All of the finished, captured sections.
protected array $sections
Результат array

$shared защищенное свойство

Data that should be available to all templates.
protected array $shared
Результат array