Beispiel #1
0
 /**
  * Prepare the response to ready to send to client.
  */
 public function prepare()
 {
     if (!$this->prepared) {
         $this->content = is_string($this->data) ? $this->data : Json::encode($this->data);
         if (!is_string($this->data)) {
             $this->headers->set('Content-Type', 'application/json');
         }
         $this->prepared = true;
     }
 }