CoreLoader
extends CoreObject
in package
implements
Loader
The CoreLoader is the default implementation of the Loader interface.
The CoreLoader is responsible for: Starting the session Preparing global vars for controller use Managing an implementation of the Site class Using the Site class to get the logged in User Using the Site class to load appropriate controllers and render views
Tags
Table of Contents
Interfaces
- Loader
- Loaders are the primary engine of applications They marshall all of the different components of the app stack, resulting in the rendered content seen by the user.
Properties
Methods
- __construct() : mixed
- getAppConfiguration() : array<string|int, mixed>
- Provides a single instance of the global app configuration to all extenders of CoreObject
- getLogger() : Logger
- Provides a single instance of a configured Logger to all extenders of CoreObject
- load() : void
- load() is responsible for taking us from the request to the rendered response.
- applyViewRenderer() : void
- Finds an appropriate ViewRenderer and sets it up for use
- checkRedirect() : void
- Check for and execute any $config requested redirects
- getConfig() : array<string|int, mixed>
- getSite() : Site
- Gets the Site context
- getViewRendererName() : string|null
- Provides the fully qualified class name of the ViewRenderer that should be used to render the response App level extenders of CoreLoader can override this method to use their own criteria to select the ViewRenderer
- loadController() : void
- Looks for the configured Controller and hands over control by executing its evaluate() method
- loadSiteClass() : void
- Looks for a configured Site implementation to utilize, falls back to CoreSite if none are found
- render() : void
- Asks the ViewRenderer to render the response
- setConfig() : void
- setSite() : void
- Sets the Site context
Properties
$config
private
array<string|int, mixed>
$config
The app configuration
$site
private
Site
$site
The Site context
Methods
__construct()
public
__construct(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
-
The app configuration
getAppConfiguration()
Provides a single instance of the global app configuration to all extenders of CoreObject
public
getAppConfiguration() : array<string|int, mixed>
Return values
array<string|int, mixed>getLogger()
Provides a single instance of a configured Logger to all extenders of CoreObject
public
getLogger() : Logger
Return values
Loggerload()
load() is responsible for taking us from the request to the rendered response.
public
load() : void
- Kick off the seesion
- Honor any $config redirect requests
- Hand execution over to a Controller
- Render the view with a ViewRenderer
applyViewRenderer()
Finds an appropriate ViewRenderer and sets it up for use
protected
applyViewRenderer() : void
checkRedirect()
Check for and execute any $config requested redirects
protected
checkRedirect() : void
getConfig()
protected
getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>getSite()
Gets the Site context
protected
getSite() : Site
Return values
Site —The active Site implementation
getViewRendererName()
Provides the fully qualified class name of the ViewRenderer that should be used to render the response App level extenders of CoreLoader can override this method to use their own criteria to select the ViewRenderer
protected
getViewRendererName() : string|null
Return values
string|null —$viewRendererName - The fully qualified class name of the ViewRenderer to be used to render the response
loadController()
Looks for the configured Controller and hands over control by executing its evaluate() method
protected
loadController() : void
loadSiteClass()
Looks for a configured Site implementation to utilize, falls back to CoreSite if none are found
protected
loadSiteClass() : void
render()
Asks the ViewRenderer to render the response
protected
render() : void
setConfig()
protected
setConfig(array<string|int, mixed> $config) : void
Parameters
- $config : array<string|int, mixed>
-
The app configuration
setSite()
Sets the Site context
protected
setSite(Site $site) : void
Parameters
- $site : Site
-
The active Site implementation