yii\web\Response::send PHP Method

send() public method

Sends the response to the client.
public send ( )
    public function send()
    {
        if ($this->isSent) {
            return;
        }
        $this->trigger(self::EVENT_BEFORE_SEND);
        $this->prepare();
        $this->trigger(self::EVENT_AFTER_PREPARE);
        $this->sendHeaders();
        $this->sendContent();
        $this->trigger(self::EVENT_AFTER_SEND);
        $this->isSent = true;
    }

Usage Example

Ejemplo n.º 1
0
 private function giveUserFile($filename)
 {
     $var = new Response();
     $var->sendFile(Yii::$app->params['uploadPath'] . $filename);
     $var->send();
     unlink(Yii::$app->params['uploadPath'] . $filename);
 }
All Usage Examples Of yii\web\Response::send