Свойство | Тип | Описание | |
---|---|---|---|
$findModel | a PHP callable that will be called to return the model corresponding to the specified primary key value. If not set, Action::findModel will be used instead. The signature of the callable should be: php function ($id, $action) { $id is the primary key value. If composite primary key, the key values will be separated by comma. $action is the action object currently running } The callable should return the model found, or throw an exception if not found. | ||
$returnAction | ID of the controller action, which user should be redirected to on success. This property overrides the value set by Action::setReturnAction method. | ||
$returnUrl | URL, which user should be redirected to on success. This could be a plain string URL, URL array configuration or callable, which returns actual URL. The signature for the callable is following: string|array function (Model $model) } Note: actual list of the callable arguments may vary depending on particular action class. Note: this option takes precedence over [[returnAction]] related logic. |
Метод | Описание | |
---|---|---|
actionExists ( string $id ) : boolean | Checks whether action with specified ID exists in owner controller. | |
createReturnUrl ( string $defaultActionId = 'index', yii\db\ActiveRecordInterface | |
||
findModel ( string $id ) : yii\db\ActiveRecordInterface | |
Returns the data model based on the primary key given. | |
getReturnAction ( string $defaultActionId = 'index' ) : string | Returns the ID of action, which should be used for return redirect. | |
setFlash ( string | array | null $message, array $params = [] ) | Sets a flash message. | |
setReturnAction ( string | null $actionId = null ) | Sets the return action ID. |
public actionExists ( string $id ) : boolean | ||
$id | string | action ID. |
Результат | boolean | whether action exists or not. |
public createReturnUrl ( string $defaultActionId = 'index', yii\db\ActiveRecordInterface | |
||
$defaultActionId | string | default action ID. |
$model | yii\db\ActiveRecordInterface | |
model being processed by action. |
Результат | array | string | URL |
public findModel ( string $id ) : yii\db\ActiveRecordInterface | |
||
$id | string | the ID of the model to be loaded. If the model has a composite primary key, the ID must be a string of the primary key values separated by commas. The order of the primary key values should follow that returned by the `primaryKey()` method of the model. |
Результат | yii\db\ActiveRecordInterface | |
the model found |
public getReturnAction ( string $defaultActionId = 'index' ) : string | ||
$defaultActionId | string | default action ID. |
Результат | string | action ID. |
public setFlash ( string | array | null $message, array $params = [] ) | ||
$message | string | array | null | flash message(s) to be set. If plain string is passed, it will be used as a message with the key 'success'. You may specify multiple messages as an array, if element name is not integer, it will be used as a key, otherwise 'success' will be used as key. If empty value passed, no flash will be set. Particular message value can be a PHP callback, which should return actual message. Such callback, should have following signature: ```php function (array $params) { // return string } ``` |
$params | array | extra params for the message parsing in format: key => value. |
public setReturnAction ( string | null $actionId = null ) | ||
$actionId | string | null | action ID, if not set current action will be used. |
public $findModel |
public $returnAction |
public $returnUrl |