Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Utils\Title Class Reference

Public Member Functions

 __construct (string $key, $ns, SiteConfig $siteConfig, ?string $fragment=null)
 
 getKey ()
 Get the DBkey.
 
 getPrefixedDBKey ()
 Get the prefixed DBkey.
 
 getPrefixedText ()
 Get the prefixed text.
 
 getFragment ()
 Get the fragment, if any.
 
 getNamespace ()
 
 getNamespaceId ()
 Get the namespace ID.
 
 equals (Title $title)
 Compare with another title.
 

Static Public Member Functions

static newFromText (string $title, SiteConfig $siteConfig, $defaultNs=0)
 
static fixSpecialName (SiteConfig $siteConfig, string $title)
 Use the default special page alias.
 

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Utils\Title::__construct ( string $key,
$ns,
SiteConfig $siteConfig,
?string $fragment = null )
Parameters
string$keyPage DBkey (with underscores, not spaces)
int | TitleNamespace$ns
SiteConfig$siteConfig
?string$fragment

Member Function Documentation

◆ equals()

Wikimedia\Parsoid\Utils\Title::equals ( Title $title)

Compare with another title.

Parameters
Title$title
Returns
bool

◆ fixSpecialName()

static Wikimedia\Parsoid\Utils\Title::fixSpecialName ( SiteConfig $siteConfig,
string $title )
static

Use the default special page alias.

Parameters
SiteConfig$siteConfig
string$title
Returns
string

◆ getFragment()

Wikimedia\Parsoid\Utils\Title::getFragment ( )

Get the fragment, if any.

Returns
string|null

◆ getKey()

Wikimedia\Parsoid\Utils\Title::getKey ( )

Get the DBkey.

Returns
string

◆ getNamespace()

Wikimedia\Parsoid\Utils\Title::getNamespace ( )
Deprecated
Use namespace IDs and SiteConfig methods instead.
Returns
TitleNamespace

◆ getNamespaceId()

Wikimedia\Parsoid\Utils\Title::getNamespaceId ( )

Get the namespace ID.

Returns
int

◆ getPrefixedDBKey()

Wikimedia\Parsoid\Utils\Title::getPrefixedDBKey ( )

Get the prefixed DBkey.

Returns
string

◆ getPrefixedText()

Wikimedia\Parsoid\Utils\Title::getPrefixedText ( )

Get the prefixed text.

Returns
string

◆ newFromText()

static Wikimedia\Parsoid\Utils\Title::newFromText ( string $title,
SiteConfig $siteConfig,
$defaultNs = 0 )
static
Parameters
string$title
SiteConfig$siteConfig
int | TitleNamespace$defaultNs
Returns
Title

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