web\Response sendFile()

sendFile() public method Sends a file to the browser. Note that this method only prepares the response for file sending. The file is not sent until send() is called explicitly or implicitly. The latter is done after you return from a controller action. The following is an example implementation of a controller action that allows requesting files from a directory that is not accessible from web: public function actionFile($filename) { $storagePath = Yii::getAlias('@app/files'); // c

web\Response sendCookies()

sendCookies() protected method Sends the cookies to the client. protected void sendCookies ( )

web\Response sendContentAsFile()

sendContentAsFile() public method Sends the specified content as a file to the browser. Note that this method only prepares the response for file sending. The file is not sent until send() is called explicitly or implicitly. The latter is done after you return from a controller action. See also sendFile() for an example implementation. public $this sendContentAsFile ( $content, $attachmentName, $options = [] )$content string The content to be sent. The existing $content will be discarded

web\Response sendContent()

sendContent() protected method Sends the response content to the client protected void sendContent ( )

web\Response send()

send() public method Sends the response to the client. public void send ( )

web\Response refresh()

refresh() public method Refreshes the current page. The effect of this method call is the same as the user pressing the refresh button of his browser (without re-posting data). In a controller action you may use this method like this: return Yii::$app->getResponse()->refresh(); public yii\web\Response refresh ( $anchor = '' )$anchor string The anchor that should be appended to the redirection URL. Defaults to empty. Make sure the anchor starts with '#' if you want to specify it.

web\Response redirect()

redirect() public method Redirects the browser to the specified URL. This method adds a "Location" header to the current response. Note that it does not send out the header until send() is called. In a controller action you may use this method as follows: return Yii::$app->getResponse()->redirect($url); In other places, if you want to send out the "Location" header immediately, you should use the following code: Yii::$app->getResponse()->redirect($url)->send(); return; In A

web\Response prepare()

prepare() protected method Prepares for sending the response. The default implementation will convert $data into $content and set headers accordingly. protected void prepare ( )throws yii\base\InvalidConfigException if the formatter for the specified format is invalid or $format is not supported

web\Response init()

init() public method Initializes this component. public void init ( )

web\Response getStatusCode()

getStatusCode() public method public integer getStatusCode ( )return integer The HTTP status code to send with the response.