本文整理汇总了PHP中UrlHelper::localized方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlHelper::localized方法的具体用法?PHP UrlHelper::localized怎么用?PHP UrlHelper::localized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UrlHelper
的用法示例。
在下文中一共展示了UrlHelper::localized方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: langLink
function langLink($text, $path, $attributes = array(), $escape = true)
{
$attributes = self::formatAttributes($attributes);
if ($path && $path[0] != '/') {
$path = $this->module . '/' . $path;
}
if ($escape) {
$text = self::escape($text);
}
return "<a href=\"" . UrlHelper::localized($path) . "\" {$attributes} >{$text}</a>";
}
示例2: setAction
final function setAction($path)
{
if (preg_match('/^https?:\\/\\//', $path)) {
$this->_action = $path;
return;
}
if (isset($path[0]) && $path[0] != '/') {
$path = $this->_context->getModule() . '/' . $path;
}
$this->_action = UrlHelper::localized($path);
}
示例3: to
static function to($url, $permanent = false)
{
$_POST = null;
//Generalize this
if (!preg_match("/^https?:/", $url)) {
$url = UrlHelper::localized($url);
}
if ($permanent) {
header("HTTP/1.1 301 Moved Permanently");
}
PluginManager::getInstance()->onRedirect($url);
Session::end(true);
header('Location: ' . $url);
exit;
}
示例4: getHeadHtml
protected function getHeadHtml()
{
$html = new HtmlHelper($this->context);
$output = '';
foreach ($this->metas as $meta) {
if ($meta['name']) {
$output .= "<meta name=\"{$meta['name']}\" content=\"" . HtmlHelper::escape($meta['content']) . "\" />\r\n";
} elseif ($meta['http-equiv']) {
$output .= "<meta http-equiv=\"{$meta['http-equiv']}\" content=\"" . HtmlHelper::escape($meta['content']) . "\" />\r\n";
}
}
$output .= "<title>" . HtmlHelper::escape($this->title) . "</title>\r\n";
$output .= '<base href="' . UrlHelper::get('/') . '"/>' . "\r\n";
if ($this->favico) {
$output .= '<link rel="icon" type="' . $this->favico[1] . "\" href=\"" . UrlHelper::resource($this->favico[0]) . "\">\r\n";
}
if ($this->description) {
$output .= '<meta name="description" content="' . HtmlHelper::escape($this->description) . "\" />\r\n";
}
if ($this->keywords) {
$output .= '<meta name="keywords" content="' . HtmlHelper::escape($this->keywords) . "\" />\r\n";
}
foreach ($this->feeds as $feed) {
$output .= '<link rel="alternate" type="application/rss+xml" title="RSS" href="' . UrlHelper::get($feed) . "\" />\r\n";
}
foreach ($this->styles as $style) {
$output .= $html->css($style[0], $style[1]) . "\r\n";
}
if ($this->js_library) {
$output .= "<script type=\"text/javascript\" src=\"{$this->js_library}\"></script>\r\n";
$output .= $html->javascript('/' . APPU_PHAXSI . '/' . 'phaxsi-' . PhaxsiConfig::FRAMEWORK_VERSION . (AppConfig::DEBUG_MODE ? '' : '.min') . '.js') . "\r\n";
$output .= HtmlHelper::inlineJavascript("Phaxsi.path = {" . "base: '" . UrlHelper::get('') . "'," . "local: '" . UrlHelper::localized('/') . "'," . "'public': '" . APPU_PUBLIC . "'," . "lang: '" . Lang::getCurrent() . "'}");
}
foreach ($this->scripts as $script) {
$output .= $html->javascript($script) . "\r\n";
}
$this->styles = $this->scripts = array();
return $output;
}