MediaWiki  REL1_31
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. More...
 
 extend ( $name, $value)
 extends the value of data with name $name with the value $value More...
 
 get ( $name, $default=null)
 Gets the template data requested. More...
 
 getHTML ()
 Fetch the output of a QuickTemplate and return it. More...
 
 getSkin ()
 Get the Skin object related to this object. More...
 
 haveData ( $str)
 
 haveMsg ( $msgKey)
 
 html ( $str)
 
 msg ( $msgKey)
 
 msgHtml ( $msgKey)
 
 msgWiki ( $msgKey)
 An ugly, ugly hack. More...
 
 set ( $name, $value)
 Sets the value $value to $name. More...
 
 setRef ( $name, &$value)
 
 setTranslator (&$t)
 
 text ( $str)
 

Public Attributes

array $data
 
MediaWikiI18N $translator
 

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$config

Definition at line 45 of file QuickTemplate.php.

References $config, data, 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 FakeAuthTemplate, SkinFallbackTemplate, and SkinApiTemplate.

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

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

◆ get()

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

Gets the template data requested.

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

Definition at line 85 of file QuickTemplate.php.

References $name, and data.

◆ getHTML()

QuickTemplate::getHTML ( )

Fetch the output of a QuickTemplate and return it.

Since
1.23
Returns
string

Definition at line 200 of file QuickTemplate.php.

References $html, and execute().

◆ getSkin()

QuickTemplate::getSkin ( )

Get the Skin object related to this object.

Returns
Skin

Definition at line 190 of file QuickTemplate.php.

References data.

Referenced by BaseTemplate\getFooter(), BaseTemplate\getMsg(), and BaseTemplate\getTrail().

◆ haveData()

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

Definition at line 170 of file QuickTemplate.php.

References data.

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

◆ haveMsg()

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

Definition at line 180 of file QuickTemplate.php.

References wfMessage().

◆ html()

QuickTemplate::html (   $str)
Access:\n private
Parameters
string$str

Definition at line 133 of file QuickTemplate.php.

References data.

Referenced by SkinApiTemplate\execute(), and SkinFallbackTemplate\execute().

◆ msg()

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

Reimplemented in BaseTemplate.

Definition at line 141 of file QuickTemplate.php.

References text(), and wfMessage().

◆ msgHtml()

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

Reimplemented in BaseTemplate.

Definition at line 149 of file QuickTemplate.php.

References wfMessage().

◆ msgWiki()

QuickTemplate::msgWiki (   $msgKey)

An ugly, ugly hack.

Access:\n private
Parameters
string$msgKey

Reimplemented in BaseTemplate.

Definition at line 158 of file QuickTemplate.php.

References $wgOut, global, and wfMessage().

◆ set()

QuickTemplate::set (   $name,
  $value 
)

Sets the value $value to $name.

Parameters
string$name
mixed$value

Definition at line 60 of file QuickTemplate.php.

References $name, $value, and data.

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

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

◆ setTranslator()

QuickTemplate::setTranslator ( $t)
Parameters
MediaWikiI18N&$t@deprecate since 1.31 Use BaseTemplate::msg() or Skin::msg() instead for setting message parameters.

Definition at line 110 of file QuickTemplate.php.

References $t, and wfDeprecated().

◆ text()

QuickTemplate::text (   $str)
Access:\n private
Parameters
string$str

Definition at line 125 of file QuickTemplate.php.

References data.

Referenced by msg().

Member Data Documentation

◆ $config

Config QuickTemplate::$config
protected

Definition at line 40 of file QuickTemplate.php.

Referenced by __construct().

◆ $data

array QuickTemplate::$data

Definition at line 32 of file QuickTemplate.php.

◆ $translator

MediaWikiI18N QuickTemplate::$translator

Definition at line 37 of file QuickTemplate.php.


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