jenkins-bot has submitted this change and it was merged.
Change subject: OutputPage: Add addHeadItems() method
......................................................................
OutputPage: Add addHeadItems() method
Right now OutputPage requires head items to have a name when using
the addHeadItem() method.
This in contrary to most of the helper methods, which don't require
a name. ParserOutput::addHeadItem() also doesn't require a name.
Since the existing signature isn't easily changed without adding
confusion, add a separate method that allow numerical indexes
to be pushed.
This ability was already exposed via addParserOutputMetadata()
and its array_merge. This method exposes it directly.
Change-Id: I433afd124b57526caa13a540cda48ba2b99a9bde
---
M includes/OutputPage.php
1 file changed, 11 insertions(+), 1 deletion(-)
Approvals:
Mattflaschen: Looks good to me, approved
Gilles: Looks good to me, but someone else must approve
Jforrester: Looks good to me, but someone else must approve
Florianschmidtwelzow: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index ecc719a..2ae5f78 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -653,7 +653,7 @@
}
/**
- * Add or replace an header item to the output
+ * Add or replace a head item to the output
*
* Whenever possible, use more specific options like ResourceLoader
modules,
* OutputPage::addLink(), OutputPage::addMetaLink() and
OutputPage::addFeedLink()
@@ -669,6 +669,16 @@
}
/**
+ * Add one or more head items to the output
+ *
+ * @since 1.28
+ * @param string|string[] $value Raw HTML
+ */
+ public function addHeadItems( $values ) {
+ $this->mHeadItems = array_merge( $this->mHeadItems,
(array)$values );
+ }
+
+ /**
* Check if the header item $name is already set
*
* @param string $name Item name
--
To view, visit https://gerrit.wikimedia.org/r/301028
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I433afd124b57526caa13a540cda48ba2b99a9bde
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits