Manual:QuickTemplate.php


 * Maybe you were looking for help on wiki templates instead?

The QuickTemplate class separates the front-end user interface (UI) from backend stuff. It has an abstract  function which shows the actual HTML of the page. The  class, which is the parent class of most skins, sets up a QuickTemplate instance with many key-value pairs, such as 'articlepath', 'loggedin', and 'titletxt', and invokes.

Most skins define their own template class that extends  which extends  ;   defines additional useful functions for skins, such as ,  , etc.

The source code documentation states that the QuickTemplate class is a [g]eneric wrapper for template functions, with interface compatible with what we use of PHPTAL 0.7.

Historical background
Ages ago, MediaWiki's skins weren't purely PHP, they used to require PHPTal. When Brion Vibber rewrote the skin system to remove PHPTal dependency, SkinTemplate and QuickTemplate classes were introduced.

Using QuickTemplate in extensions
Let's say that you're writing a new special page with a pretty UI and all that. It can prove quite difficult to do that with MediaWiki's Xml and Html classes. It is possible to use QuickTemplate in such cases.

MySpecialPage.php
You need to register the template class with MediaWiki's autoloader in your extension's setup file.

MySpecialPageTemplate.php
We can use  in the template class, because   is a reference to the SpecialMySpecialPage object which extends the SpecialPage class (and SpecialPage class has the getPageTitle method, which in turn returns a Title object, and the getFullURL is a Title method).