當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Juri::current方法代碼示例

本文整理匯總了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;
 }
開發者ID:thangredweb,項目名稱:redCORE,代碼行數:36,代碼來源:helper.php

示例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')) {
        ?>
開發者ID:Excellerate,項目名稱:excellerate-template,代碼行數:31,代碼來源:default.php

示例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>
開發者ID:Excellerate,項目名稱:mod_query,代碼行數:29,代碼來源:default.php


注:本文中的Juri::current方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。