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


PHP WikiPage::getURL方法代碼示例

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


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

示例1: parseLinkTarget

 public static function parseLinkTarget($ref)
 {
     $ref = strtr($ref, "\n", ' ');
     $parts = explode(':', $ref, 2);
     $valid = -1;
     if (count($parts) == 1) {
         $page = new WikiPage(explode('/', $ref));
         $valid = $page->isValid();
         $url = $page->getURL();
     } else {
         if ($parts[0] == 'wp') {
             $url = 'http://en.wikipedia.org/wiki/' . strtr(implode('/', array_map('urlencode', explode('/', $parts[1]))), '+', '_');
             $ref = $parts[1] . ' (Wikipedia)';
         } else {
             $url = $ref;
         }
     }
     return array($url, $ref, $valid);
 }
開發者ID:patrikf,項目名稱:ewiki,代碼行數:19,代碼來源:markup.class.php

示例2: foreach

                 if ($type == GitTree::TREEDIFF_REMOVED) {
                     $change->type = 'removed';
                 } else {
                     if ($type == GitTree::TREEDIFF_CHANGED) {
                         $change->type = 'modified';
                     } else {
                         if ($type == GitTree::TREEDIFF_ADDED) {
                             $change->type = 'added';
                         }
                     }
                 }
                 $changes[] = $change;
             }
             foreach ($changes as $change) {
                 $page = new WikiPage($change->subject);
                 $change->subject_url = $page->getURL();
             }
         }
         $commits[$i]->changes = $changes;
     }
     $view->commits = $commits;
     $view->display();
 } else {
     if ($special[0] == 'conflicts') {
         $view->setTemplate('conflicts.php');
         $conflict_branches = ls_r(sprintf('%s/refs/heads/%s', Config::GIT_PATH, Config::GIT_CONFLICT_BRANCH_DIR));
         if (!$conflict_branches) {
             $conflict_branches = array();
         }
         sort($conflict_branches);
         $conflicts = array();
開發者ID:philips,項目名稱:ewiki,代碼行數:31,代碼來源:index.php

示例3: fmt_image

 protected function fmt_image($ref, $width, $height)
 {
     if (!$width && !$height) {
         $width = Config::IMAGE_WIDTH;
         $height = Config::IMAGE_HEIGHT;
     }
     try {
         $page = new WikiPage($ref);
     } catch (Exception $e) {
         return $this->fmt_error('No such file: ' . $this->mklink($ref));
     }
     if ($page->getPageType() != WikiPage::TYPE_IMAGE) {
         return $this->fmt_error('Not an image: ' . $this->mklink($ref));
     }
     $url = $page->getURL();
     return "<div class=\"par image\"><a href=\"{$url}\"><img src=\"{$url}?action=image&amp;width={$width}&amp;height={$height}\" alt=\"{$page->getName()}\" /></a></div>";
 }
開發者ID:patrikf,項目名稱:ewiki,代碼行數:17,代碼來源:e_markup_xhtml.class.php


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