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


PHP FrontController::execute方法代碼示例

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


在下文中一共展示了FrontController::execute方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testExecute

 /**
  * Configure ACL to deny everything, thus the request must be dispatched
  * to the authentication controller.
  * 
  * @covers spriebsch\MVC\FrontController
  */
 public function testExecute()
 {
     $this->request = $this->getMock('spriebsch\\MVC\\Request', array(), array(), '', false, false);
     $this->response = $this->getMock('spriebsch\\MVC\\Response', array(), array(), '', false, false);
     $this->session = $this->getMock('spriebsch\\MVC\\Session', array(), array(), '', false, false);
     $this->authAdapter = $this->getMock('spriebsch\\MVC\\AuthenticationAdapter', array(), array(), '', false, false);
     $this->controllerFactory = $this->getMock('spriebsch\\MVC\\ControllerFactory', array(), array(), '', false, false);
     $this->viewFactory = $this->getMock('spriebsch\\MVC\\ViewFactory', array(), array(), '', false, false);
     $this->acl = $this->getMock('spriebsch\\MVC\\Acl', array(), array(), '', false, false);
     $this->appController = $this->getMock('spriebsch\\MVC\\ApplicationController', array(), array(), '', false, false);
     $this->view = $this->getMock('spriebsch\\MVC\\View', array(), array(), '', false, false);
     $this->controller = $this->getMock('spriebsch\\MVC\\Controller', array(), array(), '', false, false);
     // Controller's execute method must be called once and return 'success'.
     $this->controller->expects($this->once())->method('execute')->will($this->returnValue('success'));
     // View's render method must be called once.
     $this->view->expects($this->once())->method('render');
     // ->with($this->equalTo());
     // @todo request and response as parameters
     // The controller factory returns the controller object.
     $this->controllerFactory->expects($this->once())->method('getController')->will($this->returnValue($this->controller));
     // The application controller returns a controller name, class, and
     // method that we ignore anyway.
     $this->appController->expects($this->once())->method('getControllerName')->will($this->returnValue('controller'));
     $this->appController->expects($this->once())->method('getClass')->will($this->returnValue('class'));
     $this->appController->expects($this->once())->method('getMethod')->will($this->returnValue('method'));
     $this->appController->expects($this->once())->method('getView')->will($this->returnValue($this->view));
     $fc = new FrontController($this->request, $this->response, $this->session, $this->authAdapter, $this->acl, $this->appController, $this->controllerFactory);
     $fc->execute();
 }
開發者ID:huanganxin,項目名稱:MVC,代碼行數:35,代碼來源:FrontControllerTest.php

示例2: FrontController

<?php

error_reporting(E_ALL ^ E_STRICT);
require_once 'utility/Timer.php';
//Timer::start('Page Request');
require_once 'boot/bootstrap.php';
$f = new FrontController();
echo $f->execute();
//Timer::stop();
開發者ID:radicaldesigns,項目名稱:gtd,代碼行數:9,代碼來源:index.php


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