當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Request::get方法代碼示例

本文整理匯總了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);
 }
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:8,代碼來源:preload.php

示例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);
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:31,代碼來源:request.php

示例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!!!!');
}
開發者ID:RanLee,項目名稱:XoopsCore,代碼行數:31,代碼來源:search.php

示例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]);
 }
開發者ID:redmexico,項目名稱:XoopsCore,代碼行數:15,代碼來源:RequestTest.php


注:本文中的Xoops\Core\Request::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。