本文整理汇总了PHP中Xoops\Core\Request::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::get方法的具体用法?PHP Request::get怎么用?PHP Request::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xoops\Core\Request
的用法示例。
在下文中一共展示了Request::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eventCoreImagemanager
public static function eventCoreImagemanager($args)
{
$uri = '';
foreach (Request::get() as $k => $v) {
$uri .= urlencode($k) . '=' . urlencode($v) . '&';
}
Xoops::getInstance()->redirect("modules/images/imagemanager.php?{$uri}", 0);
}
示例2: dirname
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
use Xoops\Core\Request;
/**
* @copyright XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @author trabis <lusopoemas@gmail.com>
* @version $Id$
*/
include dirname(dirname(__DIR__)) . '/mainfile.php';
$xoops = Xoops::getInstance();
// Warning: code depending on Xoops\Core\HttpRequest may need to change
$request = \Xoops\Core\HttpRequest::getInstance();
$xoops->header();
\Xoops\Utils::dumpVar(Request::get());
$result['id'] = Request::getInt('id', 13);
$result['string'] = Request::getString('string', 'defaultValueHere');
$result['bool'] = Request::getBool('bool', false);
$result['order'] = Request::getString('order', 'ASC');
$result['url'] = $request->getUrl();
$result['uri'] = $request->getUri();
$result['referer'] = $request->getReferer();
$result['phpsessid_cookie'] = Request::getString('PHPSESSID', '', 'cookie');
$result['ip'] = $request->getClientIp();
$result['isget'] = 'GET' === Request::getMethod();
$result['ispost'] = 'POST' === Request::getMethod();
$result['ismobile'] = $request->is('mobile');
$result['isrobot'] = $request->is('robot');
$result['files'] = Request::getArray('file_identifier', array(), 'files');
\Xoops\Utils::dumpVar($result);
示例3: copyrighted
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
use Xoops\Core\Request;
/**
* XOOPS global search
*
* @copyright XOOPS Project (http://xoops.org)
* @license http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL)
* @package core
* @since 2.6.0
* @author Kazumi Ono (AKA onokazu)
* @author Taiwen Jiang <phppp@users.sourceforge.net>
* @version $Id$
* @todo Modularize; Both search algorithms and interface will be redesigned
*/
include __DIR__ . '/mainfile.php';
$xoops = Xoops::getInstance();
$uri = '';
if ($xoops->isActiveModule('search')) {
foreach (Request::get() as $k => $v) {
$uri .= urlencode($k) . '=' . urlencode($v) . '&';
}
$xoops->redirect("modules/search/index.php?{$uri}", 0);
} else {
$xoops->redirect("index.php", 10, 'Oops, Please install search module!!!!');
}
示例4: testGet
/**
* @covers Xoops\Core\Request::get
*/
public function testGet()
{
$varname = 'RequestTest';
$_REQUEST[$varname] = 'Lorem';
$get = Request::get('request');
$this->assertTrue(is_array($get));
$this->assertEquals('Lorem', $get[$varname]);
unset($get);
$_REQUEST[$varname] = '<i>Lorem ipsum </i><script>alert();</script>';
$get = Request::get('request');
$this->assertEquals('Lorem ipsum alert();', $get[$varname]);
}