当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Controller_Response_Http::clearHeaders方法代码示例

本文整理汇总了PHP中Zend_Controller_Response_Http::clearHeaders方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Response_Http::clearHeaders方法的具体用法?PHP Zend_Controller_Response_Http::clearHeaders怎么用?PHP Zend_Controller_Response_Http::clearHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Controller_Response_Http的用法示例。


在下文中一共展示了Zend_Controller_Response_Http::clearHeaders方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderDebugOutput

 /**
  * Renders page-level debugging output and replaces the original view content
  * with it. Alternatively, it could inject itself into the view content.
  *
  * @param string $originalContent Original, rendered view content
  *
  * @return string Replacement rendered view content
  */
 public function renderDebugOutput($originalContent)
 {
     $this->_response->clearHeaders();
     $this->_response->setHttpResponseCode(200);
     $this->_response->setHeader('Content-Type', 'text/html; charset=UTF-8', true);
     $this->_response->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
     return XenForo_Debug::getDebugPageWrapperHtml(XenForo_Debug::getDebugHtml());
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:16,代码来源:FrontController.php

示例2: sendResponse

 /**
  * Send response to browser with json content type
  */
 public function sendResponse()
 {
     $this->_response = Mage::app()->getResponse();
     //check redirect
     if ($this->_response->isRedirect()) {
         $headers = $this->_response->getHeaders();
         $redirect = '';
         foreach ($headers as $header) {
             if ("Location" == $header["name"]) {
                 $redirect = $header["value"];
                 break;
             }
         }
         if ($redirect) {
             $this->setRedirect($redirect);
         }
     }
     $this->_response->clearHeaders();
     $this->_response->setHeader('Content-Type', 'application/json');
     $this->_response->clearBody();
     $this->_response->setBody($this->toJson());
     $this->_response->sendResponse();
     exit;
 }
开发者ID:doctea,项目名称:VF_EasyAjax,代码行数:27,代码来源:Response.php

示例3: _sendResponse

 protected function _sendResponse($httpCode, $code, $message)
 {
     // TODO Why is sometimes sending response twice??? :S
     if (self::$responseSent) {
         return;
     }
     if (!($response = Zend_Controller_Front::getInstance()->getResponse())) {
         $response = new Zend_Controller_Response_Http();
     }
     $response->setHttpResponseCode($httpCode);
     if (!$response->getBody()) {
         $body = array('code' => $code, 'message' => $message);
         $response->setBody(Zend_Json::encode($body));
     }
     if ($response->canSendHeaders()) {
         $response->clearHeaders();
         $response->setHeader('Content-Type', 'application/json');
         $response->sendResponse();
         self::$responseSent = true;
     }
     exit;
 }
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:22,代码来源:Bootstrap.php


注:本文中的Zend_Controller_Response_Http::clearHeaders方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。