mediawiki-extensions-RSS/includes/Utils.php
Reedy 80d1b67f19 Namespace extension
Change-Id: I0894842014e1a73f419c90cf11c8334ac102242a
2022-06-25 20:02:38 +00:00

27 lines
815 B
PHP

<?php
namespace MediaWiki\Extension\RSS;
use Html;
class Utils {
/**
* Output an error message, all wrapped up nicely in HTML.
* @param string $errorMessageName The system message that this error is
* @param string[]|string|null $params Error parameter (or parameters).
* @return string HTML that is the error.
*/
public static function getErrorHtml( $errorMessageName, $params = null ) {
// Anything from a parser tag should use Content lang for message,
// since the cache doesn't vary by user language: use ->inContentLanguage()
// The ->parse() part makes everything safe from an escaping standpoint.
return Html::rawElement( 'span', [ 'class' => 'error' ],
"Extension:RSS -- Error: " . wfMessage( $errorMessageName )
->inContentLanguage()->params( $params )->parse()
);
}
}