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


PHP Xml::CloseElement方法代碼示例

本文整理匯總了PHP中Xml::CloseElement方法的典型用法代碼示例。如果您正苦於以下問題:PHP Xml::CloseElement方法的具體用法?PHP Xml::CloseElement怎麽用?PHP Xml::CloseElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Xml的用法示例。


在下文中一共展示了Xml::CloseElement方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: makeTargetList

 public function makeTargetList()
 {
     global $wgUser;
     $sk = $wgUser->getSkin();
     $targets = $this->getTargets();
     $list = Xml::openElement('ul');
     foreach ($targets as $t) {
         $link = $sk->link($t, $t->getPrefixedText(), array(), array(), array('known', 'noclasses'));
         $list .= Xml::tags('li', null, $link);
     }
     $list .= Xml::CloseElement('ul');
     return $list;
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:13,代碼來源:IndexFunction_body.php

示例2: showThreadReplies

 /**
  * @param $thread Thread
  * @param $startAt
  * @param $maxCount
  * @param $showThreads
  * @param $cascadeOptions
  * @param $interruption bool
  */
 function showThreadReplies($thread, $startAt, $maxCount, $showThreads, $cascadeOptions, $interruption = false)
 {
     $repliesClass = 'lqt-thread-replies lqt-thread-replies-' . $this->threadNestingLevel;
     if ($interruption) {
         $repliesClass .= ' lqt-thread-replies-interruption';
     }
     $div = Xml::openElement('div', array('class' => $repliesClass));
     $subthreadCount = count($thread->subthreads());
     $i = 0;
     $showCount = 0;
     $showThreads = true;
     $mustShowThreads = $cascadeOptions['mustShowThreads'];
     $replies = $thread->subthreads();
     usort($replies, array('Thread', 'createdSortCallback'));
     foreach ($replies as $st) {
         ++$i;
         // Only show undeleted threads that are above our 'startAt' index.
         $shown = false;
         if ($st->type() != Threads::TYPE_DELETED && $i >= $startAt && $showThreads) {
             if ($showCount > $maxCount && $maxCount > 0) {
                 // We've shown too many threads.
                 $link = $this->getShowMore($thread, $st, $i);
                 $this->output->addHTML($div . $link . '</div>');
                 $showThreads = false;
                 continue;
             }
             ++$showCount;
             if ($showCount == 1) {
                 // There's a post sep before each reply group to
                 //	separate from the parent thread.
                 $this->output->addHTML($div);
             }
             $this->showThread($st, $i, $subthreadCount, $cascadeOptions);
             $shown = true;
         }
         // Handle must-show threads.
         // FIXME this thread will be duplicated if somebody clicks the
         //	"show more" link (probably needs fixing in the JS)
         if ($st->type() != Threads::TYPE_DELETED && !$shown && array_key_exists($st->id(), $mustShowThreads)) {
             $this->showThread($st, $i, $subthreadCount, $cascadeOptions);
         }
     }
     // Show reply stuff
     $this->showReplyBox($thread);
     $finishDiv = '';
     $finishDiv .= Xml::tags('div', array('class' => 'lqt-replies-finish'), '&#160;');
     $this->output->addHTML($finishDiv . Xml::CloseElement('div'));
 }
開發者ID:Rikuforever,項目名稱:wiki,代碼行數:56,代碼來源:View.php


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