PHP Class yii2tech\admin\actions\Create

Since: 1.0
Author: Paul Klimov ([email protected])
Inheritance: extends Action
ファイルを表示 Open project: yii2tech/admin

Public Properties

Property Type Description
$loadDefaultValues provides control for model default values populating. If set to false - no default value population will be performed. If set to true - it will invoke loadDefaultValues() method on model. You can set this as a callable of following signature: php function ($model) { populate default values. }
$newModel a PHP callable that will be called to create the new model. If not set, Create::newModel 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.
$view name of the view, which should be rendered

Public Methods

Method Description
newModel ( ) : yii\db\ActiveRecordInterface | Model Creates new model instance.
run ( ) : mixed Creates new record.

Protected Methods

Method Description
loadModelDefaultValues ( Model $model ) Populates given model with the default values.

Method Details

loadModelDefaultValues() protected method

Populates given model with the default values.
protected loadModelDefaultValues ( Model $model )
$model yii\base\Model model to be processed.

newModel() public method

Creates new model instance.
public newModel ( ) : yii\db\ActiveRecordInterface | Model
return yii\db\ActiveRecordInterface | yii\base\Model new model instance.

run() public method

Creates new record.
public run ( ) : mixed
return mixed response

Property Details

$loadDefaultValues public_oe property

provides control for model default values populating. If set to false - no default value population will be performed. If set to true - it will invoke loadDefaultValues() method on model. You can set this as a callable of following signature: php function ($model) { populate default values. }
public $loadDefaultValues

$newModel public_oe property

a PHP callable that will be called to create the new model. If not set, Create::newModel 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 $newModel

$view public_oe property

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