本文整理汇总了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);
}
示例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();
示例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&width={$width}&height={$height}\" alt=\"{$page->getName()}\" /></a></div>";
}