public function render() { $mime = $this->_getMimetype(); $contents = $this->FS->read($this->path); $this->httpResponse->setCacheable(); $this->httpResponse->addHeader("content-type: {$mime};charset=utf-8"); $this->httpResponse->setContent($contents); $this->httpResponse->send(); }
/** * Envoyer la reponse HTTP. */ public function send() { //On definit le contenu de la reponse $this->contents = json_encode($this->responses, JSON_FORCE_OBJECT); $this->addHeader('Content-type: application/json; charset=utf-8'); //On va renvoyer du JSON parent::send(); //On envoie la reponse }
/** * Envoyer la reponse HTTP. */ public function send() { //On arrete la temporisation de sortie if (ob_get_level() > 0) { ob_end_flush(); } //On definit le contenu de la reponse $this->contents = json_encode(array('success' => $this->success, 'channels' => $this->channels, 'out' => $this->out, 'data' => $this->data, 'js' => $this->js), JSON_FORCE_OBJECT); $this->addHeader('Content-type: application/json; charset=utf-8'); //On va renvoyer du JSON parent::send(); //On envoie la reponse }
/** * Render the application. */ public function render() { $this->run(); $this->httpResponse->send(); }