當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Controller_Front::setControllerDirectory方法代碼示例

本文整理匯總了PHP中Zend_Controller_Front::setControllerDirectory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Controller_Front::setControllerDirectory方法的具體用法?PHP Zend_Controller_Front::setControllerDirectory怎麽用?PHP Zend_Controller_Front::setControllerDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Controller_Front的用法示例。


在下文中一共展示了Zend_Controller_Front::setControllerDirectory方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: testCanLoadNamespacedHelper

 public function testCanLoadNamespacedHelper()
 {
     $this->front->setControllerDirectory(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files')->setResponse(new Zend_Controller_Response_Cli())->returnResponse(true);
     $path = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files/Helpers';
     Zend_Controller_Action_HelperBroker::addPath($path, 'MyApp\\Controller\\Action\\Helper\\');
     $request = new Zend_Controller_Request_Http('http://framework.zend.com/helper-broker/test-can-load-namespaced-helper/');
     $response = $this->front->dispatch($request);
     $this->assertEquals('MyApp\\Controller\\Action\\Helper\\NamespacedHelper', $response->getBody());
 }
開發者ID:SustainableCoastlines,項目名稱:loveyourwater,代碼行數:9,代碼來源:HelperBrokerTest.php

示例3: testUsingFrontController

 public function testUsingFrontController()
 {
     $controller = new Zend_Controller_Front();
     $controller->setControllerDirectory(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files');
     $request = new Zend_Controller_Request_Http('http://framework.zend.com/empty');
     $controller->setResponse(new Zend_Controller_Response_Cli());
     $controller->setRouter(new Zend_Controller_Router());
     $plugin = new Zend_Controller_Plugin_BrokerTest_TestPlugin();
     $controller->registerPlugin($plugin);
     $response = $controller->dispatch($request);
     $this->assertEquals('123456', $response->getBody());
     $this->assertEquals('123456', $plugin->getResponse()->getBody());
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:13,代碼來源:BrokerTest.php


注:本文中的Zend_Controller_Front::setControllerDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。