PHP Класс Pop\Mvc\Controller

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$errorAction string Error action
$project Pop\Project\Project Project config object
$request Pop\Http\Request Request
$response Pop\Http\Response Response
$view View View object
$viewPath string View path

Открытые методы

Метод Описание
__construct ( Pop\Http\Request $request = null, Pop\Http\Response $response = null, Project $project = null, string $viewPath = null ) : Controller Constructor
dispatch ( string $action = 'index' ) : Controller Dispatch the controller based on the action
getErrorAction ( ) : string Get the error action
getProject ( ) : Project Get the project object
getRequest ( ) : Pop\Http\Request Get the request object
getResponse ( ) : Pop\Http\Response Get the response object
getView ( ) : View Get the view object
getViewPath ( ) : string Get the view path
send ( integer $code = 200, array $headers = null ) : void Finalize the request and send the response.
sendJson ( mixed $values, integer $code = 200, array $headers = null ) : void Method to send a JSON response
setErrorAction ( string $error ) : Controller Set the error action
setProject ( Project $project ) : Controller Set the response object
setRequest ( Pop\Http\Request $request ) : Controller Set the request object
setResponse ( Pop\Http\Response $response ) : Controller Set the response object
setViewPath ( string $viewPath ) : Controller Set the response object

Описание методов

__construct() публичный Метод

Instantiate the controller object
public __construct ( Pop\Http\Request $request = null, Pop\Http\Response $response = null, Project $project = null, string $viewPath = null ) : Controller
$request Pop\Http\Request
$response Pop\Http\Response
$project Pop\Project\Project
$viewPath string
Результат Controller

dispatch() публичный Метод

Dispatch the controller based on the action
public dispatch ( string $action = 'index' ) : Controller
$action string
Результат Controller

getErrorAction() публичный Метод

Get the error action
public getErrorAction ( ) : string
Результат string

getProject() публичный Метод

Get the project object
public getProject ( ) : Project
Результат Pop\Project\Project

getRequest() публичный Метод

Get the request object
public getRequest ( ) : Pop\Http\Request
Результат Pop\Http\Request

getResponse() публичный Метод

Get the response object
public getResponse ( ) : Pop\Http\Response
Результат Pop\Http\Response

getView() публичный Метод

Get the view object
public getView ( ) : View
Результат View

getViewPath() публичный Метод

Get the view path
public getViewPath ( ) : string
Результат string

send() публичный Метод

Finalize the request and send the response.
public send ( integer $code = 200, array $headers = null ) : void
$code integer
$headers array
Результат void

sendJson() публичный Метод

Method to send a JSON response
public sendJson ( mixed $values, integer $code = 200, array $headers = null ) : void
$values mixed
$code integer
$headers array
Результат void

setErrorAction() публичный Метод

Set the error action
public setErrorAction ( string $error ) : Controller
$error string
Результат Controller

setProject() публичный Метод

Set the response object
public setProject ( Project $project ) : Controller
$project Pop\Project\Project
Результат Controller

setRequest() публичный Метод

Set the request object
public setRequest ( Pop\Http\Request $request ) : Controller
$request Pop\Http\Request
Результат Controller

setResponse() публичный Метод

Set the response object
public setResponse ( Pop\Http\Response $response ) : Controller
$response Pop\Http\Response
Результат Controller

setViewPath() публичный Метод

Set the response object
public setViewPath ( string $viewPath ) : Controller
$viewPath string
Результат Controller

Описание свойств

$errorAction защищенное свойство

Error action
protected string $errorAction
Результат string

$project защищенное свойство

Project config object
protected Project,Pop\Project $project
Результат Pop\Project\Project

$request защищенное свойство

Request
protected Request,Pop\Http $request
Результат Pop\Http\Request

$response защищенное свойство

Response
protected Response,Pop\Http $response
Результат Pop\Http\Response

$view защищенное свойство

View object
protected View,Pop\Mvc $view
Результат View

$viewPath защищенное свойство

View path
protected string $viewPath
Результат string