MediaWiki REL1_35
QuickTemplate Class Reference

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

Inheritance diagram for QuickTemplate:
Collaboration 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.
 
 html ( $str)
 
 msg ( $msgKey)
 
 set ( $name, $value)
 Sets the value $value to $name.
 

Public Attributes

array $data
 

Protected Member Functions

 haveMsg ( $msgKey)
 
 text ( $str)
 

Protected Attributes

Config $config
 

Private Member Functions

 haveData ( $str)
 

Detailed Description

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

Stable to extend

Definition at line 30 of file QuickTemplate.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 44 of file QuickTemplate.php.

References wfDebug().

Member Function Documentation

◆ execute()

QuickTemplate::execute ( )
abstract

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

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 68 of file QuickTemplate.php.

References 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 default
-taint onlysafefor_htmlnoent

Definition at line 84 of file QuickTemplate.php.

◆ getHTML()

QuickTemplate::getHTML ( )

Fetch the output of a QuickTemplate and return it.

Since
1.23
Returns
string

Definition at line 149 of file QuickTemplate.php.

References execute().

◆ getSkin()

◆ haveData()

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

Definition at line 121 of file QuickTemplate.php.

Referenced by extend().

◆ haveMsg()

QuickTemplate::haveMsg (   $msgKey)
protected
Parameters
string$msgKey
Returns
bool

Definition at line 129 of file QuickTemplate.php.

References wfMessage().

◆ html()

QuickTemplate::html (   $str)
Parameters
string$strSecurityCheck-XSS phan-taint-check cannot tell if $str is pre-escaped

Definition at line 106 of file QuickTemplate.php.

◆ msg()

QuickTemplate::msg (   $msgKey)
Parameters
string$msgKey

Reimplemented in BaseTemplate.

Definition at line 113 of file QuickTemplate.php.

References text(), and wfMessage().

◆ set()

QuickTemplate::set (   $name,
  $value 
)

Sets the value $value to $name.

Parameters
string$name
mixed$value

Definition at line 58 of file QuickTemplate.php.

◆ text()

QuickTemplate::text (   $str)
protected
Parameters
string$strSecurityCheck-DoubleEscaped $this->data can be either

Definition at line 98 of file QuickTemplate.php.

Referenced by msg().

Member Data Documentation

◆ $config

Config QuickTemplate::$config
protected

Definition at line 39 of file QuickTemplate.php.

◆ $data

array QuickTemplate::$data

Definition at line 36 of file QuickTemplate.php.


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