Jack Phoenix has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96703
Change subject: New getTemplateHTML() method for OutputPage.
......................................................................
New getTemplateHTML() method for OutputPage.
Essentially like OutputPage's pre-existing addTemplate(), but without
calling addHTML(). This allows more flexible usage of templated HTML, as
required by some third-party extensions.
Change-Id: I943e8e50438c716b7b56d2f908da38a4bf73d9e2
---
M includes/OutputPage.php
1 file changed, 14 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/03/96703/1
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 5ffb802..abe304c 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -1636,6 +1636,20 @@
}
/**
+ * Fetch the output of a QuickTemplate and return it
+ *
+ * @param $template QuickTemplate
+ * @return String
+ */
+ public function getTemplateHTML( &$template ) {
+ ob_start();
+ $template->execute();
+ $html = ob_get_contents();
+ ob_end_clean();
+ return $html;
+ }
+
+ /**
* Parse wikitext and return the HTML.
*
* @param $text String
--
To view, visit https://gerrit.wikimedia.org/r/96703
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I943e8e50438c716b7b56d2f908da38a4bf73d9e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits