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


PHP CakeRequest::method方法代碼示例

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


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

示例1: handle

 public function handle()
 {
     if ($this->_logger instanceof Syncroton_Log) {
         $this->_logger->debug(__METHOD__ . '::' . __LINE__ . ' REQUEST METHOD: ' . $this->_request->method());
     }
     switch ($this->_request->method()) {
         case 'OPTIONS':
             $this->_handleOptions();
             break;
         case 'POST':
             $this->_handlePost();
             break;
         case 'GET':
             header("MS-Server-ActiveSync: 14.00.0536.000");
             echo "It works!<br>Your userid is: {$this->_userId} and your IP address is: {$_SERVER['REMOTE_ADDR']}.";
             break;
     }
 }
開發者ID:malamalca,項目名稱:lil-activesync,代碼行數:18,代碼來源:Server.php

示例2: testMethod

 /**
  * Test the method() method.
  *
  * @return void
  */
 public function testMethod()
 {
     $_SERVER['REQUEST_METHOD'] = 'delete';
     $request = new CakeRequest('some/path');
     $this->assertEquals('delete', $request->method());
 }
開發者ID:xMyThoLoGyx,項目名稱:centremedicaletp3,代碼行數:11,代碼來源:CakeRequestTest.php

示例3: _get_request

 /**
  * @param $data
  *
  * @return mixed
  */
 protected function _get_request($data)
 {
     $request = new CakeRequest();
     $data['request_user_agent'] = $request::header('User-Agent');
     $data['request_client_ip'] = $request->clientIp();
     $data['request_method'] = $request->method();
     $data['request_referer'] = $request->referer();
     $data['request_url'] = Router::url(null, true);
     return $data;
 }
開發者ID:andtxr,項目名稱:cakephp-log,代碼行數:15,代碼來源:LogBehavior.php


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