Class ekstazi\crud\actions\IndexAction
Inheritance | ekstazi\crud\actions\IndexAction » ekstazi\crud\actions\Action » yii\base\Action |
---|
List models 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 |
$modelClass | string | Class name of the model which will be handled by this action. | ekstazi\crud\actions\Action |
$prepareDataProvider | callable | A PHP callable that will be called to prepare a data provider that should return a collection of the models. | ekstazi\crud\actions\IndexAction |
$viewName | string | View file name | ekstazi\crud\actions\IndexAction |
Public Methods
Method | Description | Defined By |
---|---|---|
init() | ekstazi\crud\actions\Action | |
run() | ekstazi\crud\actions\IndexAction |
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 |
prepareDataProvider() | Prepares the data provider that should return the requested collection of the models. | ekstazi\crud\actions\IndexAction |
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 prepare a data provider that should return a collection of the models. If not set, prepareDataProvider() will be used instead. The signature of the callable should be:
function ($model) {
// $model is the model object
}
The callable should return an instance of \yii\data\ActiveDataProvider, or throw an exception if not valid params passed.
View file name
Method Details
Prepares the data provider that should return the requested collection of the models.
\yii\data\ActiveDataProvider prepareDataProvider( $searchModel ) | ||
$searchModel | BaseActiveRecord |
void run( ) | ||
throws | \yii\base\InvalidConfigException |
---|