Manual:QuickTemplate.php


 * Maybe you were looking for Help:Templates instead?

The QuickTemplate class, defined in, allows to separate front-end user interface (UI) from backend stuff. It is currently&mdash;quite unfortunately&mdash;used by many skins. While skins shouldn't use this class, it certainly can be useful in some situations.

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).