MediaWiki master
|
A title parser service for MediaWiki. More...
Inherited by MediaWiki\Title\MediaWikiTitleCodec.
Public Member Functions | |
makeTitleValueSafe ( $namespace, $text, $fragment='', $interwiki='') | |
Given a namespace and title, return a TitleValue if valid, or null if invalid. | |
parseTitle ( $text, $defaultNamespace=NS_MAIN) | |
Parses the given text and constructs a TitleValue. | |
A title parser service for MediaWiki.
This is designed to encapsulate knowledge about conventions for the title forms to be used in the database, in urls, in wikitext, etc.
Definition at line 35 of file TitleParser.php.
MediaWiki\Title\TitleParser::makeTitleValueSafe | ( | $namespace, | |
$text, | |||
$fragment = '', | |||
$interwiki = '' ) |
Given a namespace and title, return a TitleValue if valid, or null if invalid.
int | $namespace | |
string | $text | |
string | $fragment | |
string | $interwiki |
Implemented in MediaWiki\Title\MediaWikiTitleCodec.
MediaWiki\Title\TitleParser::parseTitle | ( | $text, | |
$defaultNamespace = NS_MAIN ) |
Parses the given text and constructs a TitleValue.
string | $text | The text to parse |
int | $defaultNamespace | Namespace to assume by default (usually NS_MAIN) |
MalformedTitleException | If the text is not a valid representation of a page title. |
Implemented in MediaWiki\Title\MediaWikiTitleCodec.