PHP Class Webiny\Component\Bootstrap\ApplicationClasses\Application

Show file Open project: Webiny/Framework Class Usage Examples

Public Methods

Method Description
__construct ( Environment $environment ) Base constructor.
getAbsolutePath ( ) : string Get application root absolute path.
getApplicationConfig ( string $query = '', null $default = null ) : mixed | ConfigObject Get the application configuration (config from App.yaml file).
getComponentConfig ( string $component, string $query = '', null $default = null ) : mixed | ConfigObject Get a component configuration (configurations from within the environment folder).
getEnvironmentConfig ( string $query = '', null $default = null ) : mixed | ConfigObject Returns the current environment configuration.
getEnvironmentName ( ) : string Get the name of current environment.
getNamespace ( ) : string Get application namespace.
getWebPath ( ) : string Get application web path.
httpResponse ( ) : Response | boolean Send the http response to the browser.
isProductionEnvironment ( ) : boolean Checks if current environment is Production.
showErrors ( ) : boolean Based on the current environment configuration, should system errors be shown or not.
view ( ) : View Get the view instance.

Private Methods

Method Description
getTemplateEngineInstance ( ) : Webiny\Component\TemplateEngine\Bridge\TemplateEngineInterface Returns template engine instance, based on current configuration.

Method Details

__construct() public method

Base constructor.
public __construct ( Environment $environment )
$environment Webiny\Component\Bootstrap\Environment Current application environment.

getAbsolutePath() public method

Get application root absolute path.
public getAbsolutePath ( ) : string
return string

getApplicationConfig() public method

Get the application configuration (config from App.yaml file).
public getApplicationConfig ( string $query = '', null $default = null ) : mixed | ConfigObject
$query string Query inside the application config.
$default null Default value which should be returned if query has no matches.
return mixed | Webiny\Component\Config\ConfigObject

getComponentConfig() public method

Get a component configuration (configurations from within the environment folder).
public getComponentConfig ( string $component, string $query = '', null $default = null ) : mixed | ConfigObject
$component string Component name.
$query string Query inside the component config.
$default null Default value which should be returned if query has no matches.
return mixed | Webiny\Component\Config\ConfigObject

getEnvironmentConfig() public method

Returns the current environment configuration.
public getEnvironmentConfig ( string $query = '', null $default = null ) : mixed | ConfigObject
$query string Query inside the environment configuration.
$default null Default value which should be returned if query has no matches.
return mixed | Webiny\Component\Config\ConfigObject

getEnvironmentName() public method

Get the name of current environment.
public getEnvironmentName ( ) : string
return string

getNamespace() public method

Get application namespace.
public getNamespace ( ) : string
return string

getWebPath() public method

Get application web path.
public getWebPath ( ) : string
return string

httpResponse() public method

This method is called automatically by the Dispatcher.
public httpResponse ( ) : Response | boolean
return Webiny\Component\Http\Response | boolean

isProductionEnvironment() public method

Checks if current environment is Production.

showErrors() public method

Based on the current environment configuration, should system errors be shown or not.
public showErrors ( ) : boolean
return boolean

view() public method

Get the view instance.
public view ( ) : View
return View