\LiftKit\Loader\FileView

View Loader

This class loads View objects from a given file path.

Summary

Methods
Properties
Constants
__construct()
load()
No public properties found
No constants found
transformPath()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(string  $basePath = '', string  $suffix = '') 

Initializes object

Parameters

string $basePath
string $suffix

load()

load(string  $path, array  $data = array()) : \LiftKit\Response\View

Loads a file and constructs a View object from it.

Parameters

string $path

Path to file. Beware that this is not an absolute path if you set the basePath or suffix in the constructor.

array $data

An associative array of variables to be injected into the view.

Throws

\LiftKit\Loader\File\Exception\NonexistentFile

Returns

\LiftKit\Response\View

transformPath()

transformPath(string  $path) : string

Prepends $basePath and appends $suffix to a path.

Parameters

string $path

Returns

string