本文整理匯總了PHP中LanguageConverter::findVariantLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP LanguageConverter::findVariantLink方法的具體用法?PHP LanguageConverter::findVariantLink怎麽用?PHP LanguageConverter::findVariantLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LanguageConverter
的用法示例。
在下文中一共展示了LanguageConverter::findVariantLink方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: findVariantLink
function findVariantLink(&$link, &$nt)
{
$oldlink = $link;
parent::findVariantLink($link, $nt);
if ($this->getPreferredVariant() == $this->mMainLanguageCode) {
$link = $oldlink;
}
}
示例2: findVariantLink
/**
* A function wrapper:
* - if there is no selected variant, leave the link
* names as they were
* - do not try to find variants for usernames
*
* @param $link string
* @param $nt Title
* @param $ignoreOtherCond bool
*/
function findVariantLink(&$link, &$nt, $ignoreOtherCond = false)
{
// check for user namespace
if (is_object($nt)) {
$ns = $nt->getNamespace();
if ($ns == NS_USER || $ns == NS_USER_TALK) {
return;
}
}
$oldlink = $link;
parent::findVariantLink($link, $nt, $ignoreOtherCond);
if ($this->getPreferredVariant() == $this->mMainLanguageCode) {
$link = $oldlink;
}
}
示例3: findVariantLink
/**
* If a language supports multiple variants, it is
* possible that non-existing link in one variant
* actually exists in another variant. this function
* tries to find it. See e.g. LanguageZh.php
* The input parameters may be modified upon return
*
* @param string &$link The name of the link
* @param Title &$nt The title object of the link
* @param bool $ignoreOtherCond To disable other conditions when
* we need to transclude a template or update a category's link
*/
public function findVariantLink(&$link, &$nt, $ignoreOtherCond = false)
{
$this->mConverter->findVariantLink($link, $nt, $ignoreOtherCond);
}