PHP Class Bluz\Controller\Controller

Author: Anton Shevchuk
Inheritance: implements JsonSerializable, use trait Bluz\Common\Helper, use trait Bluz\Response\ResponseTrait
Mostra file Open project: bluzphp/framework Class Usage Examples

Protected Properties

Property Type Description
$controller string
$data Data
$file string
$module string
$reflection Reflection
$render string One of HTML, JSON or empty string
$template string

Public Methods

Method Description
__construct ( string $module, string $controller ) Constructor of Statement
__toString ( ) : string Magic cast to string
assign ( string $key, mixed $value ) : Controller Assign key/value pair to Data object
checkAccept ( ) Check Accept
checkMethod ( ) Check Method
checkPrivilege ( ) Check Privilege
getData ( ) : Data Get controller Data container
getReflection ( ) : Reflection Get Reflection
jsonSerialize ( ) : array Specify data which should be serialized to JSON
run ( array $params = [] ) : Data __invoke

Protected Methods

Method Description
getFile ( ) : string Get controller file path
setFile ( ) : void Setup controller file
setReflection ( ) : Reflection Retrieve reflection for anonymous function

Method Details

__construct() public method

Constructor of Statement
public __construct ( string $module, string $controller )
$module string
$controller string

__toString() public method

Magic cast to string
public __toString ( ) : string
return string

assign() public method

Assign key/value pair to Data object
public assign ( string $key, mixed $value ) : Controller
$key string
$value mixed
return Controller

checkAccept() public method

Check Accept
public checkAccept ( )

checkMethod() public method

Check Method
public checkMethod ( )

checkPrivilege() public method

Check Privilege
public checkPrivilege ( )

getData() public method

Get controller Data container
public getData ( ) : Data
return Data

getFile() protected method

Get controller file path
protected getFile ( ) : string
return string

getReflection() public method

Get Reflection
public getReflection ( ) : Reflection
return Reflection

jsonSerialize() public method

Specify data which should be serialized to JSON
public jsonSerialize ( ) : array
return array

run() public method

__invoke
public run ( array $params = [] ) : Data
$params array
return Data

setFile() protected method

Setup controller file
protected setFile ( ) : void
return void

setReflection() protected method

Retrieve reflection for anonymous function
protected setReflection ( ) : Reflection
return Reflection

Property Details

$controller protected_oe property

protected string $controller
return string

$data protected_oe property

protected Data $data
return Data

$file protected_oe property

protected string $file
return string

$module protected_oe property

protected string $module
return string

$reflection protected_oe property

protected Reflection,Bluz\Controller $reflection
return Reflection

$render protected_oe property

One of HTML, JSON or empty string
protected string $render
return string

$template protected_oe property

protected string $template
return string