本文整理汇总了PHP中N2Filesystem::getBasePath方法的典型用法代码示例。如果您正苦于以下问题:PHP N2Filesystem::getBasePath方法的具体用法?PHP N2Filesystem::getBasePath怎么用?PHP N2Filesystem::getBasePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类N2Filesystem
的用法示例。
在下文中一共展示了N2Filesystem::getBasePath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateOptions
function generateOptions(&$xml)
{
$this->values = array();
$html = '';
foreach ($xml->option as $option) {
$v = N2XmlHelper::getAttribute($option, 'value');
$image = N2Uri::pathToUri($v);
$selected = $this->isSelected($v);
if ($v != -1) {
$value = $this->parseValue($image);
$this->values[] = $value;
$html .= N2Html::openTag("div", array("class" => "n2-radio-option n2-imagelist-option" . ($selected ? ' n2-active' : '')));
$ext = pathinfo($image, PATHINFO_EXTENSION);
if ($ext == 'svg') {
$image = 'data:image/svg+xml;base64,' . base64_encode(N2Filesystem::readFile(N2Filesystem::getBasePath() . $v));
}
$html .= N2Html::image($image, (string) $option, array('data-image' => $value));
$html .= N2Html::closeTag("div");
} else {
$this->values[] = -1;
$html .= N2Html::tag("div", array("class" => "n2-radio-option" . ($selected ? ' n2-active' : '')), (string) $option);
}
}
return $html;
}
示例2: pathToUri
static function pathToUri($path)
{
$i = N2Uri::getInstance();
return $i->_baseuri . str_replace(array(N2Filesystem::getBasePath(), DIRECTORY_SEPARATOR), array('', '/'), str_replace('/', DIRECTORY_SEPARATOR, $path));
}
示例3: n2_
controlsClass: "n2-modal-controls-side",
controls: [\'<a href="#" class="n2-button n2-button-big n2-button-green n2-uc n2-h4">' . n2_('Select') . '</a>\'],
content: \'\',
fn: {
show: function () {
this.content.append(nextend.browse.getNode("folder"));
this.controls.find(".n2-button-green")
.on("click", $.proxy(function (e) {
e.preventDefault();
this.hide(e);
callback(nextend.browse.getCurrentFolder());
}, this));
}
}
}
}, true);
}';
}
public static function SVGToBase64($image)
{
$ext = pathinfo($image, PATHINFO_EXTENSION);
if (substr($image, 0, 1) == '$' && $ext == 'svg') {
return 'data:image/svg+xml;base64,' . base64_encode(N2Filesystem::readFile(N2ImageHelper::fixed($image, true)));
}
return N2ImageHelper::fixed($image);
}
}
N2Loader::import('libraries.image.helper', 'platform');
N2ImageHelper::$protocolRelative = N2Settings::get('protocol-relative', '1');
N2ImageHelper::addKeyword('$', N2Filesystem::getBasePath(), N2Uri::getBaseUri());