PHP Class yii2tech\admin\actions\Index

Since: 1.0
Author: Paul Klimov ([email protected])
Inheritance: extends Action
Show file Open project: yii2tech/admin

Public Properties

Property Type Description
$newSearchModel a PHP callable that will be called to create the new search model. If not set, Index::newSearchModel will be used instead. The signature of the callable should be: php function ($action) { $action is the action object currently running } The callable should return the new model instance.
$prepareDataProvider a PHP callable that will be called to prepare a data provider that should return a collection of the models. If not set, Index::prepareDataProvider will be used instead. The signature of the callable should be: php function ($searchModel, $action) { $searchModel the search model instance $action is the action object currently running } The callable should return an instance of DataProviderInterface.
$view name of the view, which should be rendered

Public Methods

Method Description
newSearchModel ( ) : Model Creates new search model instance.
run ( ) : mixed Displays models list.

Protected Methods

Method Description
prepareDataProvider ( Model $searchModel ) : yii\data\DataProviderInterface Prepares the data provider that should return the requested collection of the models.

Method Details

newSearchModel() public method

Creates new search model instance.
public newSearchModel ( ) : Model
return yii\base\Model new model instance.

prepareDataProvider() protected method

Prepares the data provider that should return the requested collection of the models.
protected prepareDataProvider ( Model $searchModel ) : yii\data\DataProviderInterface
$searchModel yii\base\Model search model instance.
return yii\data\DataProviderInterface data provider instance.

run() public method

Displays models list.
public run ( ) : mixed
return mixed response.

Property Details

$newSearchModel public property

a PHP callable that will be called to create the new search model. If not set, Index::newSearchModel will be used instead. The signature of the callable should be: php function ($action) { $action is the action object currently running } The callable should return the new model instance.
public $newSearchModel

$prepareDataProvider public property

a PHP callable that will be called to prepare a data provider that should return a collection of the models. If not set, Index::prepareDataProvider will be used instead. The signature of the callable should be: php function ($searchModel, $action) { $searchModel the search model instance $action is the action object currently running } The callable should return an instance of DataProviderInterface.
public $prepareDataProvider

$view public property

name of the view, which should be rendered
public $view