本文整理汇总了PHP中Juri::current方法的典型用法代码示例。如果您正苦于以下问题:PHP Juri::current方法的具体用法?PHP Juri::current怎么用?PHP Juri::current使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Juri
的用法示例。
在下文中一共展示了Juri::current方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
/**
* Function for getting the list of languages
*
* @return array Language list
*/
public static function getList()
{
$app = JFactory::getApplication();
$languages = JLanguageHelper::getLanguages();
$db = JFactory::getDbo();
$Itemid = $app->input->getInt('Itemid', 0);
$uri = new JURI(Juri::current());
$uri->delVar('lang');
$uri->delVar('Itemid');
$location = htmlspecialchars($uri->getQuery());
if (!empty($location)) {
$location .= '&';
}
if (!$Itemid) {
$active = $app->getMenu()->getActive();
if ($active) {
$Itemid = $active->id;
}
}
// For every language we load menu items language specific alias and params
foreach ($languages as $i => $language) {
$db->forceLanguageTranslation = $language->lang_code;
RMenu::resetJoomlaMenuItems();
$db->forceLanguageTranslation = false;
$languages[$i]->active = $language->lang_code == JFactory::getLanguage()->getTag();
$languages[$i]->link = RRoute::_('index.php?' . $location . 'lang=' . $language->sef . ($Itemid > 0 ? '&Itemid=' . $Itemid : ''));
}
// After we are done we reset it the way it was
RMenu::resetJoomlaMenuItems();
return $languages;
}
示例2: defined
<?php
defined('_JEXEC') or die;
$q = parse_url(Juri::current());
if ($q['path'] != "/media-articles/blog") {
print '<div><a href="' . JUri::base() . 'media-articles/blog"><i class="ui left chevron icon"></i><strong>Back to main blog</strong></a></div><br>';
}
foreach ($list as $item) {
?>
<div <?php
if ($_SERVER['REQUEST_URI'] == JRoute::_(ContentHelperRoute::getCategoryRoute($item->id))) {
echo ' class="active"';
}
?>
> <?php
$levelup = $item->level - $startLevel - 1;
?>
<h<?php
echo $params->get('item_heading') + $levelup;
?>
>
<a href="<?php
echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id));
?>
">
<?php
echo $item->title;
?>
<?php
if ($params->get('numitems')) {
?>
示例3:
if ($showHeading) {
?>
<h3 class="ui devided header" style="margin-top:-15px;"><?php
echo $heading;
?>
<div class="ui sub header"><?php
echo $subHeading;
?>
</div>
</h3>
<?php
}
?>
<form class="ui query form" action="<?php
print Juri::current();
?>
" method="post">
<div class="field">
<input type="text" name="query[name]" placeholder="Full name">
</div>
<div class="field">
<input type="text" name="query[number]" placeholder="Phone number">
</div>
<div class="field">
<input type="email" name="query[email]" placeholder="Email address">
</div>