MediaWiki master
|
Represents the target of a wiki link. More...
Inherits Stringable, and ParsoidLinkTarget.
Inherited by MediaWiki\Title\Title, and MediaWiki\Title\TitleValue.
Public Member Functions | |
__toString () | |
Return an informative human-readable representation of the link target, for use in logging and debugging. | |
createFragmentTarget (string $fragment) | |
Create a new LinkTarget with a different fragment on the same page. | |
getDBkey () | |
Get the main part of the link target, in canonical database form. | |
getFragment () | |
Get the link fragment in text form (i.e. | |
getInterwiki () | |
The interwiki component of this LinkTarget. | |
getNamespace () | |
Get the namespace index. | |
getText () | |
Get the main part of the link target, in text form. | |
hasFragment () | |
Whether the link target has a fragment. | |
inNamespace (int $ns) | |
Convenience function to check if the target is in a given namespace. | |
isExternal () | |
Whether this LinkTarget has an interwiki component. | |
isSameLinkAs (ParsoidLinkTarget $other) | |
Check whether the given LinkTarget refers to the same target as this LinkTarget. | |
MediaWiki\Linker\LinkTarget::__toString | ( | ) |
Return an informative human-readable representation of the link target, for use in logging and debugging.
Implemented in MediaWiki\Title\Title, and MediaWiki\Title\TitleValue.
MediaWiki\Linker\LinkTarget::createFragmentTarget | ( | string | $fragment | ) |
Create a new LinkTarget with a different fragment on the same page.
It is expected that the same type of object will be returned, but the only requirement is that it is a LinkTarget.
string | $fragment | The fragment override, or "" to remove it. |
Implemented in MediaWiki\Title\Title, and MediaWiki\Title\TitleValue.
MediaWiki\Linker\LinkTarget::getDBkey | ( | ) |
Get the main part of the link target, in canonical database form.
The main part is the link target without namespace prefix or hash fragment. The database form means that spaces become underscores, this is also used for URLs.
Implemented in MediaWiki\Title\Title, and MediaWiki\Title\TitleValue.
Referenced by MediaWiki\Parser\Parser\getTemplateDom(), MediaWiki\Linker\Linker\makeImageLink(), and MediaWiki\Linker\Linker\makeThumbLink2().
MediaWiki\Linker\LinkTarget::getFragment | ( | ) |
Get the link fragment in text form (i.e.
the bit after the hash #
).
Implemented in MediaWiki\Title\Title, and MediaWiki\Title\TitleValue.
MediaWiki\Linker\LinkTarget::getInterwiki | ( | ) |
The interwiki component of this LinkTarget.
Implemented in MediaWiki\Title\Title, and MediaWiki\Title\TitleValue.
MediaWiki\Linker\LinkTarget::getNamespace | ( | ) |
Get the namespace index.
Implemented in MediaWiki\Title\Title, and MediaWiki\Title\TitleValue.
Referenced by MediaWiki\Title\NamespaceInfo\canHaveTalkPage(), and MediaWiki\Parser\Parser\getTemplateDom().
MediaWiki\Linker\LinkTarget::getText | ( | ) |
Get the main part of the link target, in text form.
The main part is the link target without namespace prefix or hash fragment. The text form is used for display purposes.
This is computed from the DB key by replacing any underscores with spaces.
Implemented in MediaWiki\Title\Title.
Referenced by MediaWiki\Title\NamespaceInfo\canHaveTalkPage(), MediaWiki\Parser\Parser\makeImage(), and MediaWiki\Linker\Linker\makeMediaLinkFile().
MediaWiki\Linker\LinkTarget::hasFragment | ( | ) |
Whether the link target has a fragment.
Referenced by MediaWiki\Parser\CoreParserFunctions\displaytitle().
MediaWiki\Linker\LinkTarget::inNamespace | ( | int | $ns | ) |
Convenience function to check if the target is in a given namespace.
int | $ns |
Implemented in MediaWiki\Title\Title.
MediaWiki\Linker\LinkTarget::isExternal | ( | ) |
Whether this LinkTarget has an interwiki component.
Referenced by MediaWiki\Cache\LinkBatch\addObj(), MediaWiki\Title\NamespaceInfo\canHaveTalkPage(), XmlDumpWriter\canonicalTitle(), DoubleRedirectJob\getFinalDestination(), and MediaWiki\Parser\LinkHolderArray\makeHolder().
MediaWiki\Linker\LinkTarget::isSameLinkAs | ( | ParsoidLinkTarget | $other | ) |
Check whether the given LinkTarget refers to the same target as this LinkTarget.
Two link targets are considered the same if they have the same interwiki prefix, are in the same namespace, have the same main part, and the same fragment.
ParsoidLinkTarget | $other |
Referenced by MediaWiki\Parser\Parser\fetchFileAndTitle().