Parsoid
A bidirectional parser between wikitext and HTML5
Parsoid\Utils\Title Class Reference

Public Member Functions

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

Static Public Member Functions

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

Constructor & Destructor Documentation

◆ __construct()

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 | null$fragment

Member Function Documentation

◆ equals()

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

Compare with another title.

Parameters
Title$title
Returns
bool

◆ fixSpecialName()

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

Use the default special page alias.

Parameters
SiteConfig$siteConfig
string$title
Returns
string

◆ getFragment()

Parsoid\Utils\Title::getFragment ( )

Get the fragment, if any.

Returns
string|null

◆ getKey()

Parsoid\Utils\Title::getKey ( )

Get the DBkey.

Returns
string

◆ getNamespace()

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

◆ getNamespaceId()

Parsoid\Utils\Title::getNamespaceId ( )

Get the namespace ID.

Returns
int

◆ getPrefixedDBKey()

Parsoid\Utils\Title::getPrefixedDBKey ( )

Get the prefixed DBkey.

Returns
string

◆ getPrefixedText()

Parsoid\Utils\Title::getPrefixedText ( )

Get the prefixed text.

Returns
string

◆ newFromText()

static 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: