MediaWiki
master
SpinnerWidget.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\Widget
;
4
5
use
MediaWiki\Html\Html
;
6
use Stringable;
7
17
class
SpinnerWidget
implements
Stringable {
18
20
private
$attributes;
22
private
$content;
23
27
public
function
__construct
( array $config = [] ) {
28
$size = $config[
'size'
] ??
'small'
;
29
$type = $config[
'type'
] ??
'inline'
;
30
31
$this->attributes = [];
32
33
if
( isset( $config[
'id'
] ) ) {
34
$this->attributes[
'id'
] = $config[
'id'
];
35
}
36
37
// Initialization
38
$this->attributes[
'class'
] = [
39
'mw-spinner'
,
40
$size ===
'small'
?
'mw-spinner-small'
:
'mw-spinner-large'
,
41
$type ===
'inline'
?
'mw-spinner-inline'
:
'mw-spinner-block'
,
42
];
43
44
$this->content =
45
'<div class="mw-spinner-container">'
.
46
str_repeat(
'<div></div>'
, 12 ) .
47
'</div>'
;
48
}
49
54
public
function
toString
() {
55
return
Html::rawElement(
'div'
, $this->attributes, $this->content );
56
}
57
65
public
function
__toString
() {
66
return
$this->
toString
();
67
}
68
}
MediaWiki\Html\Html
This class is a collection of static functions that serve two purposes:
Definition
Html.php:57
MediaWiki\Widget\SpinnerWidget
PHP version of jquery.spinner.
Definition
SpinnerWidget.php:17
MediaWiki\Widget\SpinnerWidget\__construct
__construct(array $config=[])
Definition
SpinnerWidget.php:27
MediaWiki\Widget\SpinnerWidget\toString
toString()
Render element into HTML.
Definition
SpinnerWidget.php:54
MediaWiki\Widget\SpinnerWidget\__toString
__toString()
Magic method implementation.
Definition
SpinnerWidget.php:65
MediaWiki\Widget
Definition
CheckMatrixWidget.php:3
includes
widget
SpinnerWidget.php
Generated on Wed Jun 18 2025 14:27:15 for MediaWiki by
1.10.0