/**
* Constructor.
* @param $key String: message key
+ * @param $params Array message parameters
+ * @param $options Array message options
* @return Message: $this
*/
public function __construct( $key, $params=array(), $options=array() ) {
$this->key = $key;
- if( $params ){
- $this->params( $params );
- }
- if( $options ){
- $this->options( $options );
+ foreach( $params as $param ){
+ $this->params( $param );
}
+ $this->options( $options );
}
/**
$this->language = Language::factory( $lang );
} else {
$type = gettype( $lang );
- throw new MWException( "Message::langauge() must be "
+ throw new MWException( __METHOD__ . " must be "
. "passed a String or Language object; $type given"
);
}
return $string;
}
- public function __tostring(){ return $this->toString(); }
-
/**
* Fully parse the text from wikitext to HTML
* @return String parsed HTML
public function parseAsBlock() {
$this->options( array(
'parse' => true,
- 'inline' => true,
+ 'inline' => false,
));
return $this->tostring();
}