attributes = [];
if ( isset( $config['id'] ) ) {
$this->attributes['id'] = $config['id'];
}
// Initialization
$this->attributes['class'] = [
'mw-spinner',
$size === 'small' ? 'mw-spinner-small' : 'mw-spinner-large',
$type === 'inline' ? 'mw-spinner-inline' : 'mw-spinner-block',
];
$this->content =
'
' .
str_repeat( '
', 12 ) .
'
';
}
/**
* Render element into HTML.
* @return string HTML serialization
*/
public function toString() {
return Html::rawElement( 'div', $this->attributes, $this->content );
}
/**
* Magic method implementation.
*
* Copied from OOUI\Tag
*
* @return string
*/
public function __toString() {
try {
return $this->toString();
} catch ( Exception $ex ) {
trigger_error( (string)$ex, E_USER_ERROR );
}
}
}