PHP 클래스 yii\rest\ActiveController

The class of the ActiveRecord should be specified via [[modelClass]], which must implement ActiveRecordInterface. By default, the following actions are supported: - index: list of models - view: return the details of a model - create: create a new model - update: update an existing model - delete: delete an existing model - options: return the allowed HTTP methods You may disable some of these actions by overriding ActiveController::actions and unsetting the corresponding actions. To add a new action, either override ActiveController::actions by appending a new action class or write a new action method. Make sure you also override ActiveController::verbs to properly declare what HTTP methods are allowed by the new action. You should usually override ActiveController::checkAccess to check whether the current user has the privilege to perform the specified action against the specified model.
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends Controller
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$createScenario the scenario used for creating a model.
$modelClass the model class name. This property must be set.
$updateScenario the scenario used for updating a model.

공개 메소드들

메소드 설명
actions ( )
checkAccess ( string $action, object $model = null, array $params = [] ) Checks the privilege of the current user.
init ( )

보호된 메소드들

메소드 설명
verbs ( )

메소드 상세

actions() 공개 메소드

public actions ( )

checkAccess() 공개 메소드

This method should be overridden to check whether the current user has the privilege to run the specified action against the specified data model. If the user does not have access, a [[ForbiddenHttpException]] should be thrown.
public checkAccess ( string $action, object $model = null, array $params = [] )
$action string the ID of the action to be executed
$model object the model to be accessed. If null, it means no specific model is being accessed.
$params array additional parameters

init() 공개 메소드

public init ( )

verbs() 보호된 메소드

protected verbs ( )

프로퍼티 상세

$createScenario 공개적으로 프로퍼티

the scenario used for creating a model.
또한 보기: yii\base\Model::scenarios()
public $createScenario

$modelClass 공개적으로 프로퍼티

the model class name. This property must be set.
public $modelClass

$updateScenario 공개적으로 프로퍼티

the scenario used for updating a model.
또한 보기: yii\base\Model::scenarios()
public $updateScenario