MediaWiki REL1_32
QuickTemplate Class Reference

Generic wrapper for template functions, with interface compatible with what we use of PHPTAL 0.7. More...

Inheritance diagram for QuickTemplate:

Public Member Functions

 __construct (Config $config=null)
 
 execute ()
 Main function, used by classes that subclass QuickTemplate to show the actual HTML output.
 
 extend ( $name, $value)
 extends the value of data with name $name with the value $value
 
 get ( $name, $default=null)
 Gets the template data requested.
 
 getHTML ()
 Fetch the output of a QuickTemplate and return it.
 
 getSkin ()
 Get the Skin object related to this object.
 
 haveData ( $str)
 
 haveMsg ( $msgKey)
 
 html ( $str)
 
 msg ( $msgKey)
 
 msgHtml ( $msgKey)
 
 msgWiki ( $msgKey)
 An ugly, ugly hack.
 
 set ( $name, $value)
 Sets the value $value to $name.
 
 setRef ( $name, &$value)
 
 text ( $str)
 

Public Attributes

array $data
 

Protected Attributes

 $config
 

Detailed Description

Generic wrapper for template functions, with interface compatible with what we use of PHPTAL 0.7.

Definition at line 27 of file QuickTemplate.php.

Constructor & Destructor Documentation

◆ __construct()

QuickTemplate::__construct ( Config $config = null)
Parameters
Config | null$config

Definition at line 40 of file QuickTemplate.php.

References $config, and wfDebug().

Member Function Documentation

◆ execute()

QuickTemplate::execute ( )
abstract

Main function, used by classes that subclass QuickTemplate to show the actual HTML output.

Reimplemented in SkinApiTemplate, SkinFallbackTemplate, FakeAuthTemplate, MonoBookTemplate, TimelessTemplate, and VectorTemplate.

Referenced by getHTML().

◆ extend()

QuickTemplate::extend ( $name,
$value )

extends the value of data with name $name with the value $value

Since
1.25
Parameters
string$name
mixed$value

Definition at line 64 of file QuickTemplate.php.

References $name, $value, and haveData().

◆ get()

QuickTemplate::get ( $name,
$default = null )

Gets the template data requested.

Since
1.22
Parameters
string$nameKey for the data
mixed | null$defaultOptional default (or null)
Returns
mixed The value of the data requested or the deafult
-taint onlysafefor_htmlnoent

Definition at line 80 of file QuickTemplate.php.

References $name.

◆ getHTML()

QuickTemplate::getHTML ( )

Fetch the output of a QuickTemplate and return it.

Since
1.23
Returns
string

Definition at line 188 of file QuickTemplate.php.

References $html, and execute().

◆ getSkin()

◆ haveData()

QuickTemplate::haveData ( $str)
Access:\n private
Parameters
string$str
Returns
bool

Definition at line 158 of file QuickTemplate.php.

Referenced by extend(), and FakeAuthTemplate\getExtraInputDefinitions().

◆ haveMsg()

QuickTemplate::haveMsg ( $msgKey)
Access:\n private
Parameters
string$msgKey
Returns
bool

Definition at line 168 of file QuickTemplate.php.

References wfMessage().

◆ html()

QuickTemplate::html ( $str)
Access:\n private
Parameters
string$str@suppress SecurityCheck-XSS phan-taint-check cannot tell if $str is pre-escaped

Definition at line 116 of file QuickTemplate.php.

Referenced by SkinApiTemplate\execute(), SkinFallbackTemplate\execute(), VectorTemplate\execute(), VectorTemplate\renderNavigation(), and VectorTemplate\renderPortal().

◆ msg()

QuickTemplate::msg ( $msgKey)
Access:\n private
Parameters
string$msgKey

Reimplemented in BaseTemplate.

Definition at line 124 of file QuickTemplate.php.

References text, and wfMessage().

◆ msgHtml()

QuickTemplate::msgHtml ( $msgKey)
Access:\n private
Parameters
string$msgKey
Warning
You should never use this method. I18n messages should be escaped
Deprecated
1.32 Use ->msg() or ->msgWiki() instead. @suppress SecurityCheck-XSS
Returns
-taint exec_html

Reimplemented in BaseTemplate.

Definition at line 136 of file QuickTemplate.php.

References wfDeprecated(), and wfMessage().

◆ msgWiki()

QuickTemplate::msgWiki ( $msgKey)

An ugly, ugly hack.

Access:\n private
Parameters
string$msgKey

Reimplemented in BaseTemplate.

Definition at line 146 of file QuickTemplate.php.

References $wgOut, and wfMessage().

◆ set()

QuickTemplate::set ( $name,
$value )

Sets the value $value to $name.

Parameters
string$name
mixed$value

Definition at line 54 of file QuickTemplate.php.

References $name, and $value.

◆ setRef()

QuickTemplate::setRef ( $name,
& $value )
Deprecated
since 1.31 This function is a now-redundant optimisation intended for very old versions of PHP. The use of references here makes the code more fragile and is incompatible with plans like T140664. Use set() instead.
Parameters
string$name
mixed&$value

Definition at line 91 of file QuickTemplate.php.

References $name, $value, and wfDeprecated().

◆ text()

QuickTemplate::text ( $str)
Access:\n private
Parameters
string$str@suppress SecurityCheck-DoubleEscaped $this->data can be either

Definition at line 107 of file QuickTemplate.php.

Member Data Documentation

◆ $config

Config QuickTemplate::$config
protected

Definition at line 35 of file QuickTemplate.php.

Referenced by __construct().

◆ $data

array QuickTemplate::$data

Definition at line 32 of file QuickTemplate.php.


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