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


PHP Request::params方法代码示例

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


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

示例1: buildParams

 private function buildParams(array $params = array())
 {
     $body = $this->request->getBody();
     if (is_array($body) === false) {
         $body = array();
     }
     if (array_key_exists(0, $body) === true) {
         $body = array(self::PARAM_REQUEST_BODY => $body);
     }
     return array_replace($this->request->params(), $body, $params);
 }
开发者ID:benconnito,项目名称:kopper,代码行数:11,代码来源:Controller.php

示例2: get

 /**
  * 
  * @return 
  */
 public function get()
 {
     // Disable strictness on model
     $this->model->setStrict(BaseSchema::STRICT_NONE);
     // handle stubs, if requested
     if ($this->request->params('stub')) {
         $data = $this->model->stub($this->request->params('stubType'));
         foreach ($data as $key => $row) {
             $data[$key] = $this->model->filter($row);
         }
         return $this->model->filter($data);
     }
     // parse the query string
     $this->parseQueryString();
     // Extract the data from the parseResult.
     // Set as separate methods so that subclasses can selectively
     // override
     $conditions = $this->getFindConditions();
     $fields = $this->getFindFields();
     $sort = $this->getFindSort();
     $limit = $this->getFindLimit();
     $skip = $this->getFindSkip();
     $misc = $this->getFindMisc();
     $field = $this->request->params('distinctCount');
     // a field name
     if ($field) {
         return $this->handleDistinctCount($field, $conditions, $misc);
     }
     $findResult = $this->model->find($conditions, $fields, $sort, $limit, $skip, $misc);
     $metaResult = [];
     if ($this->request->params('count')) {
         $metaResult['_meta']['count'] = $this->model->count($conditions);
     }
     // Pass to model for processing
     return array_merge($findResult, $metaResult);
 }
开发者ID:dwsla,项目名称:deal,代码行数:40,代码来源:BaseController.php

示例3: bind

 /**
  * Bind a request
  *
  * @param Request $request Request
  *
  * @return array
  */
 public function bind(Request $request)
 {
     $params = array('rotate' => $request->params('r'), 'negate' => $request->params('n'), 'crop' => false, 'contrast' => $request->params('c'), 'brightness' => $request->params('b'));
     if ($request->params('h') !== null && $request->params('w') !== null && $request->params('x') !== null && $request->params('y') !== null) {
         $params['crop'] = array('x' => $request->params('x'), 'y' => $request->params('y'), 'w' => $request->params('w'), 'h' => $request->params('h'));
     }
     return $params;
 }
开发者ID:Anaphore,项目名称:viewer,代码行数:15,代码来源:Viewer.php

示例4: _getAction

 private function _getAction(Request $request)
 {
     $text = $request->params('text');
     $matches = explode(" ", $text);
     return "action" . $matches[1];
 }
开发者ID:BojanZelic,项目名称:MyIRCBot,代码行数:6,代码来源:IRC.php


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