added shortcut method for commonly used method combination
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Mon, 10 Oct 2011 21:05:02 +0000 (21:05 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Mon, 10 Oct 2011 21:05:02 +0000 (21:05 +0000)
includes/OutputPage.php

index 7041518..0dc7b0c 100644 (file)
@@ -1201,6 +1201,19 @@ class OutputPage extends ContextSource {
        public function addHTML( $text ) {
                $this->mBodytext .= $text;
        }
+       
+       /**
+        * Shortcut for adding an Html::element via addHTML.
+        * 
+        * @since 1.19
+        * 
+        * @param $element string
+        * @param $attribs array
+        * @param $contents string
+        */
+       public function addElement( $element, $attribs = array(), $contents = '' ) {
+               $this->addHTML( Html::element( $element, $attribs, $contents ) );
+       }
 
        /**
         * Clear the body HTML