Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
Startup Class Reference

Starts the framework. More...

+ Inheritance diagram for Startup:

Static Public Member Functions

static run (array &$config)
 Handles the request.
 
static init (array &$config)
 Initialize the app with $config array.
 
static forward (string $url, bool $initialize=true, bool $finalize=true)
 Forwards to url.
 
static getTemplateEngineInstance ()
 Returns the template engine instance.
 
static startDefaultTemplateEngine ()
 Starts the default Template engine (Twig for Webtools).
 
static runAction (array &$u, bool $initialize=true, bool $finalize=true)
 Runs an action on a controller.
 
static runCallable (array &$u)
 Runs a callback.
 
static injectDependencies ($controller)
 Injects the dependencies from the di config key in a controller.
 
static runAsString (array &$u, bool $initialize=true, bool $finalize=true)
 Runs an action on a controller and returns a string.
 
static onError (int $code, ?string $message=null, $controllerInstance=null)
 
static logError (int $code, string $message)
 
static getController ()
 Returns the active controller name.
 
static getControllerSimpleName ()
 Returns the class simple name of the active controller.
 
static getViewNameFileExtension ()
 Returns the extension for view files.
 
static getAction ()
 Returns tha active action.
 
static getActionParams ()
 Returns the active parameters.
 
static getFrameworkDir ()
 Returns the framework directory.
 
static getApplicationDir ()
 Returns the application directory (app directory)
 
static getApplicationName ()
 Returns the application name.
 

Static Public Attributes

static $urlParts
 
static $templateEngine
 

Static Protected Member Functions

static parseUrl (&$url)
 
static _getControllerInstance (string $controllerName)
 
static startTemplateEngine (array &$config)
 
static setMainParams ($controller, $mainParams)
 

Static Protected Attributes

static $controller
 
static $action
 
static $actionParams
 

Detailed Description

Starts the framework.

This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.2.0

Definition at line 19 of file Startup.php.

Member Function Documentation

◆ _getControllerInstance()

static _getControllerInstance ( string  $controllerName)
staticprotected

Definition at line 34 of file Startup.php.

◆ forward()

static forward ( string  $url,
bool  $initialize = true,
bool  $finalize = true 
)
static

Forwards to url.

Parameters
string$urlThe url to forward to
boolean$initializeIf true, the initialize method of the controller is called
boolean$finalizeIf true, the finalize method of the controller is called

Reimplemented in StartupAsync.

Definition at line 102 of file Startup.php.

◆ getAction()

static getAction ( )
static

Returns tha active action.

Returns
string

Definition at line 318 of file Startup.php.

◆ getActionParams()

static getActionParams ( )
static

Returns the active parameters.

Returns
array

Definition at line 327 of file Startup.php.

◆ getApplicationDir()

static getApplicationDir ( )
static

Returns the application directory (app directory)

Returns
string

Definition at line 345 of file Startup.php.

◆ getApplicationName()

static getApplicationName ( )
static

Returns the application name.

Returns
string

Definition at line 354 of file Startup.php.

◆ getController()

static getController ( )
static

Returns the active controller name.

Returns
?string

Definition at line 291 of file Startup.php.

◆ getControllerSimpleName()

static getControllerSimpleName ( )
static

Returns the class simple name of the active controller.

Returns
string

Definition at line 300 of file Startup.php.

◆ getFrameworkDir()

static getFrameworkDir ( )
static

Returns the framework directory.

Returns
string

Definition at line 336 of file Startup.php.

◆ getTemplateEngineInstance()

static getTemplateEngineInstance ( )
static

Returns the template engine instance.

Returns
TemplateEngine

Definition at line 125 of file Startup.php.

◆ getViewNameFileExtension()

static getViewNameFileExtension ( )
static

Returns the extension for view files.

Returns
string

Definition at line 309 of file Startup.php.

◆ init()

static init ( array &  $config)
static

Initialize the app with $config array.

Parameters
array$config

Definition at line 84 of file Startup.php.

◆ injectDependencies()

static injectDependencies (   $controller)
static

Injects the dependencies from the di config key in a controller.

Parameters
Controller$controllerThe controller

Definition at line 225 of file Startup.php.

◆ logError()

static logError ( int  $code,
string  $message 
)
static

Definition at line 276 of file Startup.php.

◆ onError()

static onError ( int  $code,
?string  $message = null,
  $controllerInstance = null 
)
static

Definition at line 260 of file Startup.php.

◆ parseUrl()

static parseUrl ( $url)
staticprotected

Definition at line 27 of file Startup.php.

◆ run()

static run ( array &  $config)
static

Handles the request.

Parameters
array$configThe loaded config array

Definition at line 74 of file Startup.php.

◆ runAction()

static runAction ( array &  $u,
bool  $initialize = true,
bool  $finalize = true 
)
static

Runs an action on a controller.

Parameters
array$uAn array containing controller, action and parameters
boolean$initializeIf true, the initialize method of the controller is called
boolean$finalizeIf true, the finalize method of the controller is called

Reimplemented in StartupAsync.

Definition at line 155 of file Startup.php.

◆ runAsString()

static runAsString ( array &  $u,
bool  $initialize = true,
bool  $finalize = true 
)
static

Runs an action on a controller and returns a string.

Parameters
array$u
boolean$initializeIf true, the initialize method of the controller is called
boolean$finalizeIf true, the finalize method of the controller is called
Returns
string

Definition at line 254 of file Startup.php.

◆ runCallable()

static runCallable ( array &  $u)
static

Runs a callback.

Parameters
array$uAn array containing a callback, and some parameters

Definition at line 208 of file Startup.php.

◆ setMainParams()

static setMainParams (   $controller,
  $mainParams 
)
staticprotected

Definition at line 59 of file Startup.php.

◆ startDefaultTemplateEngine()

static startDefaultTemplateEngine ( )
static

Starts the default Template engine (Twig for Webtools).

Returns
TemplateEngine

Definition at line 139 of file Startup.php.

◆ startTemplateEngine()

static startTemplateEngine ( array &  $config)
staticprotected

Definition at line 46 of file Startup.php.

Field Documentation

◆ $action

$action
staticprotected

Definition at line 24 of file Startup.php.

◆ $actionParams

$actionParams
staticprotected

Definition at line 25 of file Startup.php.

◆ $controller

$controller
staticprotected

Definition at line 23 of file Startup.php.

◆ $templateEngine

$templateEngine
static

Definition at line 22 of file Startup.php.

◆ $urlParts

$urlParts
static

Definition at line 21 of file Startup.php.


The documentation for this class was generated from the following file: