当前位置: 首页>>代码示例>>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;未经允许,请勿转载。