Elgg\Http\ResponseTransport::send PHP Метод

send() публичный Метод

Sends HTTP response to the requester
public send ( Response $response ) : boolean
$response Symfony\Component\HttpFoundation\Response Symfony Response
Результат boolean
    public function send(Response $response);

Usage Example

Пример #1
0
 /**
  * Send a response
  *
  * @param Response $response Response object
  * @return Response
  */
 public function send(Response $response)
 {
     if ($this->response_sent) {
         if ($this->response_sent !== $response) {
             _elgg_services()->logger->error('Unable to send the following response: ' . PHP_EOL . (string) $response . PHP_EOL . 'because another response has already been sent: ' . PHP_EOL . (string) $this->response_sent);
         }
     } else {
         if (!elgg_trigger_before_event('send', 'http_response', $response)) {
             return false;
         }
         if (!$this->transport->send($response)) {
             return false;
         }
         elgg_trigger_after_event('send', 'http_response', $response);
         $this->response_sent = $response;
     }
     return $this->response_sent;
 }
ResponseTransport