本文整理匯總了PHP中N2Filesystem::pathToRelativePath方法的典型用法代碼示例。如果您正苦於以下問題:PHP N2Filesystem::pathToRelativePath方法的具體用法?PHP N2Filesystem::pathToRelativePath怎麽用?PHP N2Filesystem::pathToRelativePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類N2Filesystem
的用法示例。
在下文中一共展示了N2Filesystem::pathToRelativePath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
public function render($xmlpath, $data)
{
N2Loader::import('libraries.form.form');
$form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend'));
$form->loadArray($data);
$form->loadXMLFile($xmlpath);
echo $form->render('settings');
N2JS::addFirstCode('
new NextendForm("smartslider-form", ' . json_encode($form->_data) . ', null, "' . N2Filesystem::toLinux(N2Filesystem::pathToRelativePath($xmlpath)) . '", "settings", "' . N2Uri::ajaxUri('nextend', 'smartslider') . '");
');
}
示例2: fetchElement
function fetchElement()
{
$this->setfolder();
$files = N2Filesystem::files($this->_folder);
if (N2XmlHelper::getAttribute($this->_xml, 'required') == '') {
$this->_xml->addChild('option', n2_('No image'))->addAttribute('value', -1);
}
for ($i = 0; $i < count($files); $i++) {
$ext = pathinfo($files[$i], PATHINFO_EXTENSION);
if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png' || $ext == 'svg' || $ext == 'gif') {
$this->_xml->addChild('option', htmlspecialchars(ucfirst($files[$i])))->addAttribute('value', N2Filesystem::toLinux(N2Filesystem::pathToRelativePath($this->_folder . $files[$i])));
}
}
$html = N2Html::openTag("div", array('class' => 'n2-imagelist', 'style' => N2XmlHelper::getAttribute($this->_xml, 'style')));
$html .= parent::fetchElement();
$html .= N2Html::closeTag('div');
return $html;
}