|
MediaWiki master
|
A title formatter service for MediaWiki. More...

Public Member Functions | |
| __construct (Language $language, GenderCache $genderCache, NamespaceInfo $nsInfo) | |
| formatTitle ( $namespace, $text, $fragment='', $interwiki='') | |
| Returns the title formatted for display. | |
| getFullText ( $title) | |
| Returns the title formatted for display, with namespace and fragment. | |
| getNamespaceName ( $namespace, $text) | |
| Returns the name of the namespace for the given title. | |
| getPrefixedDBkey ( $target) | |
| Return the title in prefixed database key form, with interwiki and namespace. | |
| getPrefixedText ( $title) | |
| Returns the title formatted for display, including the namespace name. | |
| getText ( $title) | |
| Returns the title text formatted for display, without namespace or fragment. | |
Protected Attributes | |
| GenderCache | $genderCache |
| Language | $language |
| NamespaceInfo | $nsInfo |
A title formatter 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 32 of file TitleFormatter.php.
| MediaWiki\Title\TitleFormatter::__construct | ( | Language | $language, |
| GenderCache | $genderCache, | ||
| NamespaceInfo | $nsInfo ) |
| Language | $language | The language object to use for localizing namespace names, capitalization, etc. |
| GenderCache | $genderCache | The gender cache for generating gendered namespace names |
| NamespaceInfo | $nsInfo |
Definition at line 43 of file TitleFormatter.php.
References MediaWiki\Title\TitleFormatter\$genderCache, MediaWiki\Title\TitleFormatter\$language, and MediaWiki\Title\TitleFormatter\$nsInfo.
| MediaWiki\Title\TitleFormatter::formatTitle | ( | $namespace, | |
| $text, | |||
| $fragment = '', | |||
| $interwiki = '' ) |
Returns the title formatted for display.
By default, this includes the namespace but not the fragment.
| int | false | $namespace | The namespace ID (or false, if the namespace should be ignored) |
| string | $text | The page title. Should be valid. Only minimal normalization is applied. Underscores will be replaced. |
| string | $fragment | The fragment name (may be empty). |
| string | $interwiki | The interwiki prefix (may be empty). |
| InvalidArgumentException | If the namespace is invalid |
Definition at line 68 of file TitleFormatter.php.
References MediaWiki\Title\TitleFormatter\getNamespaceName(), and NS_SPECIAL.
Referenced by MediaWiki\Title\TitleFormatter\getFullText(), MediaWiki\Title\TitleFormatter\getPrefixedDBkey(), and MediaWiki\Title\TitleFormatter\getPrefixedText().
| MediaWiki\Title\TitleFormatter::getFullText | ( | $title | ) |
Returns the title formatted for display, with namespace and fragment.
| LinkTarget | PageReference | $title | The title to format |
Definition at line 177 of file TitleFormatter.php.
References MediaWiki\Title\TitleFormatter\formatTitle().
| MediaWiki\Title\TitleFormatter::getNamespaceName | ( | $namespace, | |
| $text ) |
Returns the name of the namespace for the given title.
| int | $namespace | |
| string | $text |
| InvalidArgumentException | If the namespace is invalid |
Definition at line 207 of file TitleFormatter.php.
Referenced by MediaWiki\Title\TitleFormatter\formatTitle().
| MediaWiki\Title\TitleFormatter::getPrefixedDBkey | ( | $target | ) |
Return the title in prefixed database key form, with interwiki and namespace.
| LinkTarget | PageReference | $target |
Definition at line 151 of file TitleFormatter.php.
References MediaWiki\Title\TitleFormatter\formatTitle().
| MediaWiki\Title\TitleFormatter::getPrefixedText | ( | $title | ) |
Returns the title formatted for display, including the namespace name.
| LinkTarget | PageReference | $title | The title to format |
Definition at line 120 of file TitleFormatter.php.
References MediaWiki\Title\TitleFormatter\formatTitle().
| MediaWiki\Title\TitleFormatter::getText | ( | $title | ) |
Returns the title text formatted for display, without namespace or fragment.
| LinkTarget | PageReference | $title | The title to format |
Definition at line 102 of file TitleFormatter.php.
|
protected |
Definition at line 34 of file TitleFormatter.php.
Referenced by MediaWiki\Title\TitleFormatter\__construct().
|
protected |
Definition at line 33 of file TitleFormatter.php.
Referenced by MediaWiki\Title\TitleFormatter\__construct().
|
protected |
Definition at line 35 of file TitleFormatter.php.
Referenced by MediaWiki\Title\TitleFormatter\__construct().