MediaWiki  1.33.0
TitleParser Interface Reference

A title parser service for MediaWiki. More...

Inheritance diagram for TitleParser:

Public Member Functions

 parseTitle ( $text, $defaultNamespace=NS_MAIN)
 Parses the given text and constructs a TitleValue. More...
 

Detailed Description

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.

See also
https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue
Since
1.23

Definition at line 33 of file TitleParser.php.

Member Function Documentation

◆ parseTitle()

TitleParser::parseTitle (   $text,
  $defaultNamespace = NS_MAIN 
)

Parses the given text and constructs a TitleValue.

Normalization is applied according to the rules appropriate for the form specified by $form.

Note
this only parses local page links, interwiki-prefixes etc. are not considered!
Parameters
string$textThe text to parse
int$defaultNamespaceNamespace to assume per default (usually NS_MAIN)
Exceptions
MalformedTitleExceptionIf the text is not a valid representation of a page title.
Returns
TitleValue

Implemented in MediaWikiTitleCodec.


The documentation for this interface was generated from the following file: