Свойство | Type | Description | |
---|---|---|---|
$actionParams | the parameters bound to the current action. | ||
$enableCsrfValidation | whether to enable CSRF validation for the actions in this controller. CSRF validation is enabled only when both this property and [[\yii\web\Request::enableCsrfValidation]] are true. |
Méthode | Description | |
---|---|---|
asJson ( mixed $data ) : |
Send data formatted as JSON. | |
asXml ( mixed $data ) : |
Send data formatted as XML. | |
beforeAction ( $action ) | ||
bindActionParams ( |
Binds the parameters to the action. | |
goBack ( string | array $defaultUrl = null ) : |
Redirects the browser to the last visited page. | |
goHome ( ) : |
Redirects the browser to the home page. | |
redirect ( string | array $url, integer $statusCode = 302 ) : |
Redirects the browser to the specified URL. | |
refresh ( string $anchor = '' ) : |
Refreshes the current page. | |
renderAjax ( string $view, array $params = [] ) : string | Renders a view in response to an AJAX request. |
public bindActionParams ( |
||
$action | the action to be bound with parameters | |
$params | array | the parameters to be bound to the action |
Résultat | array | the valid parameters that the action can run with. |
public goBack ( string | array $defaultUrl = null ) : |
||
$defaultUrl | string | array | the default return URL in case it was not set previously. If this is null and the return URL was not set previously, [[Application::homeUrl]] will be redirected to. Please refer to [[User::setReturnUrl()]] on accepted format of the URL. |
Résultat | the current response object |
public goHome ( ) : |
||
Résultat | the current response object |
public redirect ( string | array $url, integer $statusCode = 302 ) : |
||
$url | string | array | the URL to be redirected to. This can be in one of the following formats: - a string representing a URL (e.g. "http://example.com") - a string representing a URL alias (e.g. "@example.com") - an array in the format of `[$route, ...name-value pairs...]` (e.g. `['site/index', 'ref' => 1]`) [[Url::to()]] will be used to convert the array into a URL. Any relative URL will be converted into an absolute one by prepending it with the host info of the current request. |
$statusCode | integer | the HTTP status code. Defaults to 302.
See |
Résultat | the current response object |