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


PHP Request::getPath方法代碼示例

本文整理匯總了PHP中Xoops\Core\Request::getPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::getPath方法的具體用法?PHP Request::getPath怎麽用?PHP Request::getPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Xoops\Core\Request的用法示例。


在下文中一共展示了Request::getPath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: implode

$xoops->disableErrorReporting();
$xoops->simpleHeader(false);
$helper->loadLanguage('admin');
$helper->loadLanguage('tinymce');
$op = Request::getCmd('op', '');
if ($op === 'save') {
    if (!$xoops->security()->check()) {
        $xoops->redirect('xoops_xlanguage.php', 2, implode(',', $xoops->security()->getErrors()));
    }
    XoopsLoad::load('system', 'system');
    $msg[] = _AM_SMILIES_SAVE;
    $obj = $helper->getHandlerSmilies()->create();
    $obj->setVar('smiley_code', Request::getString('smiley_code', ''));
    $obj->setVar('smiley_emotion', Request::getString('smiley_emotion', ''));
    $obj->setVar('smiley_display', Request::getBool('smiley_display', 1));
    $obj->setVar('smiley_url', 'smilies/' . Request::getPath('smiley_url', ''));
    $xoops_upload_file = Request::getArray('xoops_upload_file', array());
    $mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
    $upload_size = 500000;
    $uploader = new XoopsMediaUploader(\XoopsBaseConfig::get('uploads-path') . '/smilies', $mimetypes, $upload_size, null, null);
    if ($uploader->fetchMedia($xoops_upload_file[0])) {
        $uploader->setPrefix('smil');
        if (!$uploader->upload()) {
            $msg[] = $uploader->getErrors();
            $obj->setVar('smiley_url', 'blank.gif');
        } else {
            $obj->setVar('smiley_url', 'smilies/' . $uploader->getSavedFileName());
        }
    }
    if ($helper->getHandlerSmilies()->insert($obj)) {
        $xoops->redirect('xoops_smilies.php', 2, implode('<br />', $msg));
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:31,代碼來源:xoops_smilies.php

示例2: testGetPath

 /**
  * @covers Xoops\Core\Request::getPath
  */
 public function testGetPath()
 {
     $varname = 'RequestTest';
     $_REQUEST[$varname] = '/var/tmp';
     $this->assertEquals($_REQUEST[$varname], Request::getPath($varname), Request::getPath($varname));
     $_REQUEST[$varname] = ' modules/test/index.php?id=12 ';
     $this->assertEquals('modules/test/index.php?id=12', Request::getPath($varname), Request::getPath($varname));
     $_REQUEST[$varname] = '/var/tmp muck';
     $this->assertEquals('/var/tmp', Request::getPath($varname), Request::getPath($varname));
 }
開發者ID:redmexico,項目名稱:XoopsCore,代碼行數:13,代碼來源:RequestTest.php


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