ApplicationController
extends AbstractController
in package
Console application controller class
Tags
Table of Contents
Properties
- $application : Application|null
- Application object
- $bypassMaintenance : bool
- Bypass maintenance false
- $console : Console|null
- Console object
- $defaultAction : string
- Default action
- $maintenanceAction : string
- Maintenance action
Methods
- __construct() : mixed
- Constructor for the controller
- application() : Application
- Get application object
- bypassMaintenance() : bool
- Check the bypass maintenance check
- console() : Console
- Get request object
- createCommand() : void
- Create custom command
- createController() : void
- Create controller command
- createModel() : void
- Create model command
- createView() : void
- Create view command
- dispatch() : void
- Dispatch the controller based on the action
- dispatchMaintenance() : void
- Dispatch the maintenance action
- down() : void
- Down command
- env() : void
- Env command
- error() : void
- Default error action method
- getApplication() : Application|null
- Get application object
- getConsole() : Console|null
- Get console object
- getDefaultAction() : string
- Get the default action
- getMaintenanceAction() : string
- Get the maintenance action
- hasApplication() : bool
- Has application object
- hasConsole() : bool
- Has console object
- init() : void
- Init command
- setApplication() : static
- Set application object
- setBypassMaintenance() : static
- Check the bypass maintenance check
- setConsole() : static
- Set console object
- setDefaultAction() : static
- Set the default action
- setMaintenanceAction() : static
- Set the maintenance action
- status() : void
- Status command
- up() : void
- Up command
- displayEnv() : void
- Display the colorized environment alert box for the given environment
- setEnv() : void
- Set application environment
Properties
$application
Application object
protected
Application|null
$application
= null
$bypassMaintenance
Bypass maintenance false
protected
bool
$bypassMaintenance
= true
$console
Console object
protected
Console|null
$console
= null
$defaultAction
Default action
protected
string
$defaultAction
= 'error'
$maintenanceAction
Maintenance action
protected
string
$maintenanceAction
= 'maintenance'
Methods
__construct()
Constructor for the controller
public
__construct(Application $application[, Console $console = new Console(120) ]) : mixed
Parameters
- $application : Application
- $console : Console = new Console(120)
application()
Get application object
public
application() : Application
Return values
ApplicationbypassMaintenance()
Check the bypass maintenance check
public
bypassMaintenance() : bool
Return values
boolconsole()
Get request object
public
console() : Console
Return values
ConsolecreateCommand()
Create custom command
public
createCommand(string $command[, array<string|int, mixed> $options = [] ]) : void
Parameters
- $command : string
- $options : array<string|int, mixed> = []
createController()
Create controller command
public
createController(string $ctrl[, array<string|int, mixed> $options = [] ]) : void
Parameters
- $ctrl : string
- $options : array<string|int, mixed> = []
createModel()
Create model command
public
createModel(string $model[, array<string|int, mixed> $options = [] ]) : void
Parameters
- $model : string
- $options : array<string|int, mixed> = []
createView()
Create view command
public
createView(string $view) : void
Parameters
- $view : string
dispatch()
Dispatch the controller based on the action
public
dispatch([string|null $action = null ][, array<string|int, mixed>|null $params = null ]) : void
Parameters
- $action : string|null = null
- $params : array<string|int, mixed>|null = null
Tags
dispatchMaintenance()
Dispatch the maintenance action
public
dispatchMaintenance() : void
Tags
down()
Down command
public
down([array<string|int, mixed> $options = [] ]) : void
Parameters
- $options : array<string|int, mixed> = []
env()
Env command
public
env([array<string|int, mixed> $options = [] ]) : void
Parameters
- $options : array<string|int, mixed> = []
error()
Default error action method
public
error() : void
Tags
getApplication()
Get application object
public
getApplication() : Application|null
Return values
Application|nullgetConsole()
Get console object
public
getConsole() : Console|null
Return values
Console|nullgetDefaultAction()
Get the default action
public
getDefaultAction() : string
Return values
stringgetMaintenanceAction()
Get the maintenance action
public
getMaintenanceAction() : string
Return values
stringhasApplication()
Has application object
public
hasApplication() : bool
Return values
boolhasConsole()
Has console object
public
hasConsole() : bool
Return values
boolinit()
Init command
public
init() : void
setApplication()
Set application object
public
setApplication(Application $application) : static
Parameters
- $application : Application
Return values
staticsetBypassMaintenance()
Check the bypass maintenance check
public
setBypassMaintenance([bool $bypass = true ]) : static
Parameters
- $bypass : bool = true
Return values
staticsetConsole()
Set console object
public
setConsole([Console $console = new Console(120) ]) : static
Parameters
- $console : Console = new Console(120)
Return values
staticsetDefaultAction()
Set the default action
public
setDefaultAction(string $default) : static
Parameters
- $default : string
Return values
staticsetMaintenanceAction()
Set the maintenance action
public
setMaintenanceAction(string $maintenance) : static
Parameters
- $maintenance : string
Return values
staticstatus()
Status command
public
status() : void
up()
Up command
public
up() : void
displayEnv()
Display the colorized environment alert box for the given environment
protected
displayEnv(string $env) : void
Parameters
- $env : string
setEnv()
Set application environment
protected
setEnv() : void