本文整理汇总了PHP中SpecialPage::getPageTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP SpecialPage::getPageTitle方法的具体用法?PHP SpecialPage::getPageTitle怎么用?PHP SpecialPage::getPageTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecialPage
的用法示例。
在下文中一共展示了SpecialPage::getPageTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeSpecialPage
/**
* @param SpecialPage $page The special page to execute
* @param string $subPage The subpage parameter to call the page with
* @param WebRequest|null $request Web request that may contain URL parameters, etc
* @param Language|string|null $language The language which should be used in the context
* @param User|null $user The user which should be used in the context of this special page
*
* @throws Exception
* @return array( string, WebResponse ) A two-elements array containing the HTML output
* generated by the special page as well as the response object.
*/
public function executeSpecialPage(SpecialPage $page, $subPage = '', WebRequest $request = null, $language = null, User $user = null)
{
$context = $this->newContext($request, $language, $user);
$output = new OutputPage($context);
$context->setOutput($output);
$page->setContext($context);
$output->setTitle($page->getPageTitle());
$html = $this->getHTMLFromSpecialPage($page, $subPage);
$response = $context->getRequest()->response();
if ($response instanceof FauxResponse) {
$code = $response->getStatusCode();
if ($code > 0) {
$response->header('Status: ' . $code . ' ' . HttpStatus::getMessage($code));
}
}
return [$html, $response];
}
示例2: formatActionValue
/**
* @return string Formatted table cell contents
*/
protected function formatActionValue($row)
{
$target = SpecialGlobalRenameQueue::PAGE_PROCESS_REQUEST . '/' . $row->rq_id;
if ($this->showOpenRequests()) {
$label = 'globalrenamequeue-action-address';
} else {
$target .= '/' . SpecialGlobalRenameQueue::ACTION_VIEW;
$label = 'globalrenamequeue-action-view';
}
return Html::element('a', array('href' => $this->mOwner->getPageTitle($target)->getFullURL(), 'class' => 'mw-ui-progressive'), $this->msg($label)->text());
}
示例3: getPageTitle
/**
* Get the Title being used for this instance.
* SpecialPage extends ContextSource as of 1.18.
*
* @since 0.1
*
* @param boolean $subPage
*
* @return Title
*/
public function getPageTitle($subPage = false)
{
return version_compare($GLOBALS['wgVersion'], '1.18', '>') ? parent::getPageTitle() : $GLOBALS['wgTitle'];
}