Renderer Class

Aurora\Web\Glow Namespace


Properties

cacheEnabled

Whether cache is enabled or not

protected $cacheEnabled: bool

templatesDir

Templates directory

protected $templatesDir: string

cacheDir

Cache directory

protected $cacheDir: string

blocks

Blocks array

protected $blocks = []: array

Constructor

__construct

Constructor

Parameters

  • string $templatesDir — Templates directory
  • string $cacheDir — Cache directory

Signature

public function __construct(string $templatesDir, string $cacheDir)

Methods

__construct

Constructor

Parameters

  • string $templatesDir — Templates directory
  • string $cacheDir — Cache directory

Signature

public function __construct(string $templatesDir, string $cacheDir)

getCacheEnabled

Get cache status

Return Value

  • bool

Signature

public function getCacheEnabled(): bool

setCacheEnabled

Set cache status

Parameters

  • bool $enabled — Status of cache

Signature

public function setCacheEnabled(bool $enabled)

render

Render template

Parameters

  • string $template — Template name
  • array $data — Template data

Return Value

  • string

Signature

public function render(string $template, array $data): string

cache

Cache the template

Parameters

  • string $file — Template name

Return Value

  • string

Signature

public function cache(string $file): string

compileCode

Compile template code

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compileCode(string $code): string

includeFiles

Include all the required files

Parameters

  • string $file — Template name

Return Value

  • string

Signature

protected function includeFiles(string $file): string

removePHP

Remove PHP blocks

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function removePHP(string $code): string

compileComments

Compile comment blocks

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compileComments(string $code): string

compilePHP

Compile PHP blocks

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compilePHP(string $code): string

compileEchos

Compile echo directives

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compileEchos(string $code): string

compileEscapedEchos

Compile escaped echo directives

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compileEscapedEchos(string $code): string

compileBlock

Compile blocks

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compileBlock(string $code): string

compileYield

Compile yield directives

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compileYield(string $code): string

compileDefaults

Compile default directives

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compileDefaults(string $code): string

fixSwitchCase

Fix switch directives

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function fixSwitchCase(string $code): string

deleteBlankLines

Delete blank lines

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function deleteBlankLines(string $code): string

compileFilters

Compile directive filters

Parameters

  • string $code — Directive code

Return Value

  • string

Signature

protected function compileFilters(string $code): string

stackFilters

Flatten filter stack

Parameters

  • array $filters — Filter stack

Return Value

  • string

Signature

protected function stackFilters(array $filters): string

compileTags

Compile tag directives

Parameters

  • string $code — Template code

Return Value

  • string

Signature

protected function compileTags(string $code): string

resolveFilter

Resolve filter

Parameters

  • string $filter — Filter name
  • mixed $args — Filter arguments
  • string $code — Filter code

Return Value

  • string

Signature

protected function resolveFilter(string $filter, mixed $args, string $code): string

checkAuth

Check authentication status

Return Value

  • bool

Signature

protected function checkAuth(): bool

getCsrfToken

Get CSRF token

Return Value

  • string

Signature

protected function getCsrfToken(): string

Go to top