Class ekstazi\crud\actions\DeleteAction
Inheritance | ekstazi\crud\actions\DeleteAction » ekstazi\crud\actions\Action » yii\base\Action |
---|
Delete model action
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$checkAccess | callable | A PHP callable that will be called when running an action to determine if the current user has the permission to execute the action. | ekstazi\crud\actions\Action |
$findModel | callable | A PHP callable that will be called to return the model corresponding to the specified primary key value. | ekstazi\crud\actions\DeleteAction |
$modelClass | string | Class name of the model which will be handled by this action. | ekstazi\crud\actions\Action |
$redirectTo | mixed | The route to redirect to. | ekstazi\crud\actions\DeleteAction |
Public Methods
Method | Description | Defined By |
---|---|---|
init() | ekstazi\crud\actions\Action | |
run() | ekstazi\crud\actions\DeleteAction |
Protected Methods
Method | Description | Defined By |
---|---|---|
ensureAccess() | Ensure this action is allowed for current user | ekstazi\crud\actions\Action |
findModel() | Find model by its pk from params otherwise the not found exception will be thrown | ekstazi\crud\actions\Action |
findModelByPk() | Extract pk from params and find model | ekstazi\crud\actions\Action |
redirect() | Redirect to route passed as param | ekstazi\crud\actions\Action |
saveModel() | ekstazi\crud\actions\Action |
Property Details
A PHP callable that will be called to return the model corresponding to the specified primary key value. If not set, findModelByPk() will be used instead. The signature of the callable should be:
function ($params) {
// $params is the params from request
}
The callable should return the model found. Otherwise the not found exception will be thrown.
The route to redirect to. It can be one of the followings:
- A PHP callable. The callable will be executed to get route. The signature of the callable should be:
function ($model){
// $model is the model object.
}
The callable should return route/url to redirect to.
- An array. Treated as route.
- A string. Treated as url.
Method Details
void run( ) | ||
throws | \yii\db\StaleObjectException | |
---|---|---|
throws | \yii\web\BadRequestHttpException | |
throws | \yii\web\NotFoundHttpException |