Class Loader
Handles the loading of various files and objects
Final
Package: minPHP\
lib
Located at lib/loader.php
Methods summary
protected
|
#
__construct( )
Protected constructor to prevent instance creation
Protected constructor to prevent instance creation
|
public static
|
#
loadModels( object & $parent, array $models )
Loads models, which may or may not exist within a plugin of the same name.
First looks in the plugin directory, if no match is found, looks in the models
directory.
Loads models, which may or may not exist within a plugin of the same name.
First looks in the plugin directory, if no match is found, looks in the models
directory.
Parameters
- $parent
object $parent The object to which to attach the given models
- $models
array $models An array of models to load and initialize
Throws
|
public static
|
#
loadComponents( object & $parent, array $components )
Loads the given components, attaching them to the given parent object.
Loads the given components, attaching them to the given parent object.
Parameters
- $parent
object $parent The parent to which to attach the given components
- $components
array $components An array of components and [optionally] their parameters
|
public static
|
#
loadHelpers( object & $parent, array $helpers )
Loads the given helpers, attaching them to the given parent object.
Loads the given helpers, attaching them to the given parent object.
Parameters
- $parent
object $parent The parent to which to attach the given helpers
- $helpers
array $helpers An array of helpers and [optionally] their parameters
|
public static
string
|
#
toCamelCase( string $str )
Convert a string to "CamelCase" from "file_case"
Convert a string to "CamelCase" from "file_case"
Parameters
- $str
string $str the string to convert
Returns
string the converted string
|
public static
string
|
#
fromCamelCase( string $str )
Convert a string to "file_case" from "CamelCase".
Convert a string to "file_case" from "CamelCase".
Parameters
- $str
string $str the string to convert
Returns
string the converted string
|
public static
boolean
|
#
load( string $file )
Attempts to include the given file, if it exists.
Attempts to include the given file, if it exists.
Parameters
- $file
string $file The file to include
Returns
boolean Returns true if the file exists and could be included, false otherwise
|
private static
|
#
loadAndInitialize( object & $parent, string $type, array $objects )
Loads an initializes the named objects of the given type to the given parent
object. Recognized types include "component" and "helper".
Loads an initializes the named objects of the given type to the given parent
object. Recognized types include "component" and "helper".
Parameters
- $parent
object $parent The parent object to attach the named objects
- $type
string $type The collection the named objects belong to
- $objects
array $objects The named objects to load and initialize
Throws
Exception
Throw when invoked with unrecognized $type
|
Magic methods summary