本文整理匯總了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]);
}