本文整理汇总了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));
示例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));
}