Skip to content

Loader

  • Full name: \Qubus\View\Loader
  • This class is marked as final and can't be subclassed
  • This class implements: \Qubus\View\Renderer
  • This class is a Final class

Constants

Constant Visibility Type Value
VERSION public '3.0.0'
CLASS_PREFIX public '__ScaffoldTemplate_'
RECOMPILE_NEVER public -1
RECOMPILE_NORMAL public 0
RECOMPILE_ALWAYS public 1

Properties

exceptionHandler

private bool $exceptionHandler

target

private \Qubus\View\Adapter\Adapter $target

options

private array $options

paths

private array $paths

cache

private array $cache

extension

private string $extension

Methods

__construct

public __construct(array $options = []): mixed

Parameters:

Parameter Type Description
$options array

handleSyntaxError

protected handleSyntaxError(mixed $exception): void

Parameters:

Parameter Type Description
$exception mixed

Throws:


getTemplateExtension

Get the expected extension of the template file.

private getTemplateExtension(): string

removeExtension

Remove Extension from file.

private removeExtension(string $fileName): string

Parameters:

Parameter Type Description
$fileName string

getClassName

private getClassName(string $path): string

Parameters:

Parameter Type Description
$path string

normalizePath

public normalizePath(string $path): array

Parameters:

Parameter Type Description
$path string

resolvePath

public resolvePath(string $template, string $from = ''): string

Parameters:

Parameter Type Description
$template string
$from string

getAdapter

protected getAdapter(): \Qubus\View\Adapter\Adapter

compile

public compile(string $template, mixed $mode = null): \Qubus\View\Loader

Parameters:

Parameter Type Description
$template string
$mode mixed

load

public load(string|\Qubus\View\Template $template, string $from = ''): mixed

Parameters:

Parameter Type Description
$template string|\Qubus\View\Template
$from string

Throws:


compileOrFail

private compileOrFail(\Qubus\View\Adapter\Adapter $adapter, string $path, string $class, string $classFile): void

Parameters:

Parameter Type Description
$adapter \Qubus\View\Adapter\Adapter
$path string
$class string
$classFile string

loadFromString

public loadFromString(mixed $template): mixed

Parameters:

Parameter Type Description
$template mixed

Throws:


render

public render(\Qubus\View\Template|string $template, array $data = []): void

Parameters:

Parameter Type Description
$template \Qubus\View\Template|string
$data array

Throws:


renderString

public renderString(mixed $source, array $data = []): mixed

Parameters:

Parameter Type Description
$source mixed
$data array

Throws:


getVersion

public getVersion(): string

setExceptionHandler

public setExceptionHandler(bool $bool = true): \Qubus\View\Loader

Parameters:

Parameter Type Description
$bool bool


Automatically generated on 2025-10-13