本文整理汇总了PHP中Bluz\Proxy\Request::isPost方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::isPost方法的具体用法?PHP Request::isPost怎么用?PHP Request::isPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bluz\Proxy\Request
的用法示例。
在下文中一共展示了Request::isPost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIsMethods
/**
* Test `Is` Methods
*/
public function testIsMethods()
{
$this->assertTrue(Request::isGet());
$this->assertFalse(Request::isPost());
$this->assertFalse(Request::isPut());
$this->assertFalse(Request::isDelete());
$this->assertFalse(Request::isFlashRequest());
$this->assertFalse(Request::isXmlHttpRequest());
}
示例2: function
return function ($email = null, $password = null, $token = null) {
/**
* @var Controller $this
*/
// change layout
$this->useLayout('small.phtml');
$userId = $this->user() ? $this->user()->id : null;
/**
* @var Users\Row $user
*/
$user = Users\Table::findRow($userId);
if (!$user) {
throw new NotFoundException('User not found');
}
$this->assign('email', $user->email);
if (Request::isPost()) {
// process form
try {
if (empty($password)) {
throw new Exception('Password is empty');
}
// login/password
Auth\Table::getInstance()->checkEquals($user->login, $password);
// check email for unique
$emailUnique = Users\Table::findRowWhere(['email' => $email]);
if ($emailUnique && $emailUnique->id != $userId) {
throw new Exception('User with email "' . htmlentities($email) . '" already exists');
}
// generate change mail token and get full url
$actionRow = UsersActions\Table::getInstance()->generate($userId, Table::ACTION_CHANGE_EMAIL, 5, ['email' => $email]);
$changeUrl = Router::getFullUrl('users', 'change-email', ['token' => $actionRow->code]);