PHP 클래스 Pop\Mvc\Controller

저자: Nick Sagona, III ([email protected])
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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