X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fskins%2FQuickTemplate.php;h=af2d5daaf8b976a2d854ce3a4cf78d6a7cebca4f;hb=41fdde6e811ff3aaf12ad334bb0dee0e2e41b373;hp=b28dc511685db139efcd36583ded7f8a97f9e472;hpb=2502264bd729ec717b6a3f81b4dbd7871c6fbc6a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/skins/QuickTemplate.php b/includes/skins/QuickTemplate.php index b28dc51168..af2d5daaf8 100644 --- a/includes/skins/QuickTemplate.php +++ b/includes/skins/QuickTemplate.php @@ -32,7 +32,7 @@ abstract class QuickTemplate { * @param Config $config */ function __construct( Config $config = null ) { - $this->data = array(); + $this->data = []; $this->translator = new MediaWikiI18N(); if ( $config === null ) { wfDebug( __METHOD__ . ' was called with no Config instance passed to it' ); @@ -50,6 +50,20 @@ abstract class QuickTemplate { $this->data[$name] = $value; } + /** + * extends the value of data with name $name with the value $value + * @since 1.25 + * @param string $name + * @param mixed $value + */ + public function extend( $name, $value ) { + if ( $this->haveData( $name ) ) { + $this->data[$name] = $this->data[$name] . $value; + } else { + $this->data[$name] = $value; + } + } + /** * Gets the template data requested * @since 1.22