本文整理汇总了PHP中Xoops\Core\Request::getFloat方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getFloat方法的具体用法?PHP Request::getFloat怎么用?PHP Request::getFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xoops\Core\Request
的用法示例。
在下文中一共展示了Request::getFloat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetFloat
/**
* @covers Xoops\Core\Request::getFloat
*/
public function testGetFloat()
{
$varname = 'RequestTest';
$_REQUEST[$varname] = '1.23';
$this->assertEquals(1.23, Request::getFloat($varname));
$_REQUEST[$varname] = '-1.23';
$this->assertEquals(-1.23, Request::getFloat($varname));
$_REQUEST[$varname] = '5.68 blah blah';
$this->assertEquals(5.68, Request::getFloat($varname));
$_REQUEST[$varname] = '1';
$this->assertTrue(1.0 === Request::getFloat($varname));
}
示例2:
if ($xoops->getConfig('allow_chgmail') == 1) {
$edituser->setVar('email', $email);
}
if ($password != '') {
$edituser->setVar('pass', password_hash($password, PASSWORD_DEFAULT));
}
$edituser->setVar('url', $xoops->formatURL(Request::getUrl('url', '')));
$edituser->setVar('user_icq', Request::getString('user_icq', ''));
$edituser->setVar('user_from', Request::getString('user_from', ''));
$edituser->setVar('user_sig', XoopsLocale::substr(Request::getString('user_sig', ''), 0, 255));
$edituser->setVar('user_viewemail', Request::getBool('user_viewemail', 0));
$edituser->setVar('user_aim', Request::getString('user_aim', ''));
$edituser->setVar('user_yim', Request::getString('user_yim', ''));
$edituser->setVar('user_msnm', Request::getString('user_msnm', ''));
$edituser->setVar('attachsig', Request::getBool('attachsig', 0));
$edituser->setVar('timezone_offset', Request::getFloat('timezone_offset', 0));
$edituser->setVar('uorder', Request::getInt('uorder', 0));
$edituser->setVar('umode', Request::getString('umode', 'flat'));
$edituser->setVar('notify_method', Request::getInt('notify_method', 1));
$edituser->setVar('notify_mode', Request::getInt('notify_mode', 1));
$edituser->setVar('bio', XoopsLocale::substr(Request::getString('bio', ''), 0, 255));
$edituser->setVar('user_occ', Request::getString('user_occ', ''));
$edituser->setVar('user_intrest', Request::getString('user_intrest', ''));
$edituser->setVar('user_mailok', Request::getBool('user_mailok', 0));
if (!$member_handler->insertUser($edituser)) {
$xoops->header();
echo $edituser->getHtmlErrors();
$xoops->footer();
} else {
$xoops->redirect('userinfo.php?uid=' . $uid, 1, XoopsLocale::S_YOUR_PROFILE_UPDATED);
}