Class ekstazi\crud\actions\CreateAction

Inheritanceekstazi\crud\actions\CreateAction » ekstazi\crud\actions\Action » yii\base\Action

Create model action

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined 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
$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\CreateAction
$saveModel callable A PHP callable that will be called to save model. ekstazi\crud\actions\CreateAction
$scenario string The scenario to be assigned to the new model before it is validated and saved. ekstazi\crud\actions\CreateAction
$viewName string View file name ekstazi\crud\actions\CreateAction

Protected Methods

Hide inherited methods

MethodDescriptionDefined 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

$redirectTo public property
mixed $redirectTo null

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.
$saveModel public property

A PHP callable that will be called to save model. If not set, {{BaseActiveRecord::save}} will be used instead. The signature of the callable should be:

function($model){
    
// $model is the model object to save.
}

The callable should return status of saving operation

$scenario public property
string $scenario = \yii\base\Model::SCENARIO_DEFAULT

The scenario to be assigned to the new model before it is validated and saved.

$viewName public property
string $viewName 'create'

View file name

Method Details

init() public method

void init( )
throws \yii\base\InvalidConfigException
run() public method

void run( )
throws \yii\web\ForbiddenHttpException