\LiftKit\Loader\FileScript

Script Loader

This loader is for including files, which may or may not return a value.

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()) : mixed

Includes a PHP file and returns any result returned by the file.

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 file.

Throws

\LiftKit\Loader\File\Exception\NonexistentFile

Returns

mixed

transformPath()

transformPath(string  $path) : string

Prepends $basePath and appends $suffix to a path.

Parameters

string $path

Returns

string