PHP Trait yii2tech\admin\actions\ModelFormTrait

This trait should be used inside the descendant of Action class.
Since: 1.0
Author: Paul Klimov ([email protected])
Datei anzeigen Open project: yii2tech/admin

Public Properties

Property Type Description
$flash flash message to be set on success.
$scenario the scenario to be assigned to the new model before it is validated and saved.

Protected Methods

Method Description
load ( Model $model, array $data ) : boolean Populates the model with input data.
performAjaxValidation ( Model $model ) : array Performs AJAX validation of the model via [[ActiveForm::validate()]].

Method Details

load() protected method

Populates the model with input data.
protected load ( Model $model, array $data ) : boolean
$model yii\base\Model model instance.
$data array the data array to load, typically `$_POST` or `$_GET`.
return boolean whether expected forms are found in `$data`.

performAjaxValidation() protected method

Performs AJAX validation of the model via [[ActiveForm::validate()]].
protected performAjaxValidation ( Model $model ) : array
$model yii\base\Model main model.
return array the error message array indexed by the attribute IDs.

Property Details

$flash public_oe property

flash message to be set on success.
See also: Action::setFlash() for details on how setup flash.
public $flash

$scenario public_oe property

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