PHP Class yii2tech\admin\CrudController
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: the details of a model
-
create: create a new model
-
update: update an existing model
-
delete: delete an existing model
You may disable some of these actions by overriding
CrudController::actions and unsetting the corresponding actions.
Mostra file
Open project: yii2tech/admin
Class Usage Examples
Public Properties
Property |
Type |
Description |
|
$createScenario |
|
the scenario used for creating a model. |
|
$modelClass |
|
the model class name. This property must be set.
The model class must implement [[ActiveRecordInterface]]. |
|
$searchModelClass |
|
class name of the model which should be used as search model.
If not set it will be composed using [[modelClass]]. |
|
$updateScenario |
|
the scenario used for updating a model. |
|
Public Methods
Method Details
accessRules()
public method
This is method is a shortcut, allowing quick adjustment of the [[AccessControl]] filter attached at
CrudController::behaviors.
Be careful in case you override
CrudController::behaviors method, since it may loose configuration provided by this method.
public accessRules ( ) : array |
return |
array |
list of access rules. See [[AccessControl::rules]] for details about rule specification. |
behaviors()
public method
Property Details
$createScenario public_oe property
the scenario used for creating a model.
$modelClass public_oe property
the model class name. This property must be set.
The model class must implement [[ActiveRecordInterface]].
$searchModelClass public_oe property
class name of the model which should be used as search model.
If not set it will be composed using [[modelClass]].
$updateScenario public_oe property
the scenario used for updating a model.