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


PHP Response::setDI方法代碼示例

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


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

示例1: setUp

 public function setUp()
 {
     $di = new DI();
     $_SERVER['HTTP_HOST'] = 'example.com';
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $_SERVER['REQUEST_URI'] = '/path?foo=aaa&bar=bbb';
     $_GET = array('_url' => '/path', 'foo' => 'aaa', 'bar' => 'bbb');
     $request = new Request();
     $request->setDI($di);
     $this->request = $request;
     $response = new Response();
     $response->setDI($di);
     $this->response = $response;
     $eventsManager = new Manager();
     $cors = new Cors(array(array('domain' => 'bar.com')));
     $di->set('request', $request, true);
     $di->set('response', $response, true);
     $di->set('eventsManager', $eventsManager);
     $di->set('cors', $cors);
     $this->di = $di;
     $application = new Application();
     $application->setDI($di);
     $application->setEventsManager($eventsManager);
     $this->application = $application;
 }
開發者ID:evaengine,項目名稱:evaengine,代碼行數:25,代碼來源:CorsTest.php

示例2: setUp

 /**
  *
  */
 public function setUp()
 {
     $di = new DI();
     $_SERVER['HTTP_HOST'] = 'example.com';
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $_SERVER['REQUEST_URI'] = '/path?foo=aaa&bar=bbb';
     $_GET = array('_url' => '/path', 'foo' => 'aaa', 'bar' => 'bbb');
     $request = new Request();
     $request->setDI($di);
     $this->request = $request;
     $response = new Response();
     $response->setDI($di);
     $dispatcher = new Dispatcher();
     $dispatcher->setDI($di);
     $this->dispatcher = $dispatcher;
     $cache = new BackendCache(new FrontendCache());
     $di->set('viewCache', $cache);
     $config = new Config(array('cache' => array('enable' => true)));
     $di->set('config', $config);
     $eventsManager = new Manager();
     $di->set('request', $request, true);
     $di->set('response', $response, true);
     $di->set('dispatcher', $dispatcher, true);
     $di->set('eventsManager', $eventsManager);
     $this->di = $di;
     $application = new Application();
     $application->setDI($di);
     $application->setEventsManager($eventsManager);
     $this->application = $application;
 }
開發者ID:hushibing,項目名稱:EvaEngine,代碼行數:33,代碼來源:DispatchTest.php

示例3: setDI

 public function setDI(DiInterface $di)
 {
     parent::setDI($di);
 }
開發者ID:mattvb91,項目名稱:cphalcon,代碼行數:4,代碼來源:Response.php


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