Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315896

Change subject: BaseTemplate: Make getMsg() calling pattern more like 
wfMessage()
......................................................................

BaseTemplate: Make getMsg() calling pattern more like wfMessage()

wfMessage() and IContextSource::msg() allow you to pass parameters to
the message in the initial function call, which is often more convenient
for developers. Support that in BaseTemplate::getMsg() too for
standardization.

Change-Id: I2488234f431be5bab00ca4366d864c84d7ff9e03
---
M includes/skins/BaseTemplate.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/315896/1

diff --git a/includes/skins/BaseTemplate.php b/includes/skins/BaseTemplate.php
index 87865df..6ea8b89 100644
--- a/includes/skins/BaseTemplate.php
+++ b/includes/skins/BaseTemplate.php
@@ -29,10 +29,11 @@
         * Get a Message object with its context set
         *
         * @param string $name Message name
+        * @param ... $params Message params
         * @return Message
         */
-       public function getMsg( $name ) {
-               return $this->getSkin()->msg( $name );
+       public function getMsg( $name /* ... */ ) {
+               return call_user_func_array( [ $this->getSkin(), 'msg' ], 
func_get_args() );
        }
 
        function msg( $str ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/315896
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2488234f431be5bab00ca4366d864c84d7ff9e03
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to