本文整理匯總了PHP中ParserOptions::getExternalLinkTarget方法的典型用法代碼示例。如果您正苦於以下問題:PHP ParserOptions::getExternalLinkTarget方法的具體用法?PHP ParserOptions::getExternalLinkTarget怎麽用?PHP ParserOptions::getExternalLinkTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ParserOptions
的用法示例。
在下文中一共展示了ParserOptions::getExternalLinkTarget方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: makeImage
//.........這裏部分代碼省略.........
if ($handler->validateParam('height', $height)) {
$params[$type]['height'] = $height;
$validated = true;
}
}
# else no validation -- bug 13436
} else {
if ($type === 'handler') {
# Validate handler parameter
$validated = $handler->validateParam($paramName, $value);
} else {
# Validate internal parameters
switch ($paramName) {
case 'manualthumb':
case 'alt':
case 'class':
# @todo FIXME: Possibly check validity here for
# manualthumb? downstream behavior seems odd with
# missing manual thumbs.
$validated = true;
$value = $this->stripAltText($value, $holders);
break;
case 'link':
$chars = self::EXT_LINK_URL_CLASS;
$prots = $this->mUrlProtocols;
if ($value === '') {
$paramName = 'no-link';
$value = true;
$validated = true;
} elseif (preg_match("/^(?i){$prots}/", $value)) {
if (preg_match("/^((?i){$prots}){$chars}+\$/u", $value, $m)) {
$paramName = 'link-url';
$this->mOutput->addExternalLink($value);
if ($this->mOptions->getExternalLinkTarget()) {
$params[$type]['link-target'] = $this->mOptions->getExternalLinkTarget();
}
$validated = true;
}
} else {
$linkTitle = Title::newFromText($value);
if ($linkTitle) {
$paramName = 'link-title';
$value = $linkTitle;
$this->mOutput->addLink($linkTitle);
$validated = true;
}
}
break;
default:
# Most other things appear to be empty or numeric...
$validated = $value === false || is_numeric(trim($value));
}
}
if ($validated) {
$params[$type][$paramName] = $value;
}
}
}
if (!$validated) {
$caption = $part;
}
}
# Process alignment parameters
if ($params['horizAlign']) {
$params['frame']['align'] = key($params['horizAlign']);
}