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


PHP Zend_Controller_Front::returnResponse方法代码示例

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


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

示例1: setUp

    public function setUp()
    {
        $savePath = ini_get('session.save_path');
        if (strpos($savePath, ';')) {
            $savePath = explode(';', $savePath);
            $savePath = array_pop($savePath);
        }
        if (empty($savePath)) {
            $this->markTestSkipped('Cannot test FlashMessenger due to unavailable session save path');
        }

        if (headers_sent()) {
            $this->markTestSkipped('Cannot test FlashMessenger: cannot start session because headers already sent');
        }
        Zend_Session::start();

        $this->front      = Zend_Controller_Front::getInstance();
        $this->front->resetInstance();
        $this->front->setControllerDirectory(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . '_files');
        $this->front->returnResponse(true);
        $this->request    = new Zend_Controller_Request_Http();
        $this->request->setControllerName('helper-flash-messenger');
        $this->response   = new Zend_Controller_Response_Cli();
        $this->controller = new HelperFlashMessengerController($this->request, $this->response, array());
        $this->helper     = new Zend_Controller_Action_Helper_FlashMessenger($this->controller);
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:26,代码来源:FlashMessengerTest.php

示例2: testCustomHelperFromPath

 public function testCustomHelperFromPath()
 {
     $this->front->setControllerDirectory(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files');
     $request = new Zend_Controller_Request_Http('http://framework.zend.com/helper-broker/test-custom-helper/');
     $this->front->setResponse(new Zend_Controller_Response_Cli());
     $this->front->returnResponse(true);
     Zend_Controller_Action_HelperBroker::addPath(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Helpers', 'MyApp');
     $response = $this->front->dispatch($request);
     $this->assertEquals('MyApp_TestHelper', $response->getBody());
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:10,代码来源:HelperBrokerTest.php

示例3: dispatch

 /**
  * Dispatches the request
  *
  * @param  Zend_Controller_Front $frontController - The frontcontroller
  * @return Zend_Controller_Response_Abstract
  */
 public function dispatch(Zend_Controller_Front $frontController, Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null)
 {
     // Return the response
     $frontController->returnResponse(true);
     return $frontController->dispatch();
 }
开发者ID:BGCX261,项目名称:zoocms-svn-to-git,代码行数:12,代码来源:application.php

示例4: _processRequestStack

 /**
  * Processes the requestStack and merges their responses into $response.
  *
  * @param Zend_Controller_Front $front
  * @param Zend_Controller_Response_Abstract $response
  *
  */
 protected function _processRequestStack($front, Zend_Controller_Response_Abstract $response)
 {
     $stack =& $this->_requestStack;
     $config =& $this->_config;
     $i = count($stack) - 1;
     $responseStack = array();
     $front->returnResponse(true);
     do {
         $myResponse = new Zend_Controller_Response_Http();
         $nextRequest = array_pop($stack);
         $nextRequest->setParam($config['indexKey'], $i);
         $this->_resetHelper();
         $this->_resetPlugins();
         $this->_resetParams($nextRequest->getParams());
         $front->setRequest($nextRequest);
         $front->setResponse($myResponse);
         $responseStack[] = $front->dispatch($nextRequest, $myResponse);
     } while ($i--);
     $front->returnResponse(false);
     $bodies = array();
     for ($i = 0, $len = count($responseStack); $i < $len; $i++) {
         $bodies[] = $responseStack[$i]->getBody();
     }
     $body = implode(',', $bodies);
     $response->setBody('[' . $body . ']');
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:33,代码来源:ExtRequest.php

示例5: run

 /**
  * Dispatches all requests. 
  *
  * @param  Zend_Controller_Front $controller
  * @return array|null Array of Response objects, or null if no tasks
  */
 public function run(Zend_Controller_Front $controller)
 {
     $router = $controller->getRouter();
     $returnResponse = $controller->returnResponse();
     $responses = array();
     foreach ($this->_requests as $request) {
         if ($request->getControllerName()) {
             // Use default router
             $controller->setRouter(new Zend_Controller_Router());
         }
         if ($returnResponse) {
             $responses[] = $controller->dispatch($request);
         }
         $controller->setRouter($router);
     }
     $this->_completed = true;
     return $responses;
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:24,代码来源:Task.php


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