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


PHP CakeRequest::data方法代码示例

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


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

示例1: _checkFields

/**
 * Checks the fields to ensure they are supplied.
 *
 * @param CakeRequest $request The request that contains login information.
 * @param string $model The model used for login verification.
 * @param array $fields The fields to be checked.
 * @return boolean False if the fields have not been supplied. True if they exist.
 */
	protected function _checkFields(CakeRequest $request, $model, $fields) {
		if (empty($request->data[$model])) {
			return false;
		}
		foreach (array($fields['username'], $fields['password']) as $field) {
			$value = $request->data($model . '.' . $field);
			if (empty($value) || !is_string($value)) {
				return false;
			}
		}
		return true;
	}
开发者ID:hungnt88,项目名称:5stars-1,代码行数:20,代码来源:FormAuthenticate.php

示例2: authenticate

 public function authenticate(CakeRequest $request, CakeResponse $response)
 {
     $params = json_decode($request->query('params'), true);
     if (!isset($params['username'])) {
         $params = json_decode($request->data('params'), true);
     }
     $options = array('conditions' => array('User.username' . $this->userController->User->username => $params['username']));
     $result = $this->userController->User->find('first', $options);
     if ($result) {
         $password = sha1($result['User']['username'] . $result['User']['password']);
         if ("Promobot" . $password == $params['auth']) {
             return $result['User'];
         }
     }
     return false;
 }
开发者ID:JesusRugama,项目名称:Promobot,代码行数:16,代码来源:AppAuthenticate.php

示例3: testDataWritingFalsey

 /**
  * Test writing falsey values.
  *
  * @return void
  */
 public function testDataWritingFalsey()
 {
     $request = new CakeRequest('posts/index');
     $request->data('Post.null', null);
     $this->assertNull($request->data['Post']['null']);
     $request->data('Post.false', false);
     $this->assertFalse($request->data['Post']['false']);
     $request->data('Post.zero', 0);
     $this->assertSame(0, $request->data['Post']['zero']);
     $request->data('Post.empty', '');
     $this->assertSame('', $request->data['Post']['empty']);
 }
开发者ID:xMyThoLoGyx,项目名称:centremedicaletp3,代码行数:17,代码来源:CakeRequestTest.php

示例4: checkFields

 /**
  * Checks the fields to ensure they are supplied.
  *
  * @param CakeRequest $request The request that contains login information.
  * @param string $model The model used for login verification.
  * @return bool False if the fields have not been supplied. True if they exist.
  */
 protected function checkFields(CakeRequest $request, $model)
 {
     if (empty($request->data[$model])) {
         return false;
     }
     foreach (array($this->settings['fields']['username'], $this->settings['fields']['password']) as $field) {
         $value = $request->data($model . '.' . $field);
         if (empty($value) && $value !== '0' || !is_string($value)) {
             return false;
         }
     }
     return true;
 }
开发者ID:loadsys,项目名称:cakephp-stateless-auth,代码行数:20,代码来源:TokenLoginLogoutAuthenticate.php

示例5: setConditionContent

 private static function setConditionContent(stdClass $std, CakeRequest $request)
 {
     $paginateOrmName = self::PAGINATE_ORM_NAME;
     $value = $request->data(['CategoriesSearch']);
     if (!empty($value['content'])) {
         $fieldName = $paginateOrmName . '.content Like';
         $std->conditions[0]['or'][$fieldName] = '%' . $value['content'] . '%';
     }
 }
开发者ID:Shiro-Nwal,项目名称:sin-kaisha-khine,代码行数:9,代码来源:CategoriesSearch1.php


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