\FW\StructuresApp

Abstract main class that all FW-kit apps extend

Summary

Methods
Properties
Constants
__construct()
init()
setupEnvironment()
onLoad()
loadAsDependent()
run()
loadModule()
container()
getInstance()
No public properties found
No constants found
No protected methods found
$currentInstance
$container
$path
$config
N/A
No private methods found
$modules
$interfaces
N/A

Properties

$currentInstance

$currentInstance : \FW\Structures\App

Current application instance

Type

\FW\Structures\App

$container

$container : \FW\Utils\Container

App dependency container

Type

\FW\Utils\Container

$path

$path : string

Filepath of the application (relative to the fw_api root dir)

Type

string

$modules

$modules : array

Default module values for the config file

Type

array

$interfaces

$interfaces : array

Interfaces for the default set of modules that must be implemented if a custom implementation is created

Type

array

Methods

__construct()

__construct(\FW\Utils\Container  $container) 

Constructs the app with the given container

Parameters

\FW\Utils\Container $container

init()

init(array  $modules = array(), boolean  $isFull = true) 

Initializes the application

This handles all of the module setup and initialization

Parameters

array $modules
boolean $isFull

If this app is being booted as a full application or just as a dependent app

setupEnvironment()

setupEnvironment(string  $env = 'development') 

Sets up the environment (error handling, debug, etc.)

Parameters

string $env

The environment to run under (default is development)

onLoad()

onLoad() 

Method to be implemented by app main classes Called at the end of the initialization cycle

loadAsDependent()

loadAsDependent(\FW\Utils\Container  $parentContainer) 

If the application is loaded as a dependent app, this method will be called with the parent container instance.

Parameters

\FW\Utils\Container $parentContainer

run()

run() 

Runs the router (called at the end of everything)

loadModule()

loadModule(string  $name) 

Loads a module given a name

Parameters

string $name

The module name

container()

container(string  $key) : mixed

Returns a given value from the container

Parameters

string $key

Key to return

Returns

mixed —

Value from the container

getInstance()

getInstance() : \FW\Structures\App

Get the current application instance

Returns

\FW\Structures\App

the current instance