-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModal.php
38 lines (31 loc) · 964 Bytes
/
Modal.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace bdb\bootstrap;
use Yii;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
/**
* This is just an example.
*/
class Modal extends \yii\bootstrap\Modal {
/**
* Renders the close button.
* @return string the rendering result
*/
protected function renderCloseButton()
{
if ($this->closeButton !== false) {
$tag = ArrayHelper::remove($this->closeButton, 'tag', 'button');
$label = ArrayHelper::remove($this->closeButton, 'label', '×');
$class = ArrayHelper::remove($this->closeButton, 'class');
if ($tag === 'button' && !isset($this->closeButton['type'])) {
$this->closeButton['type'] = 'button';
}
if($class != null) {
$this->closeButton['class'] = 'close '.$class;
}
return Html::tag($tag, $label, $this->closeButton);
} else {
return null;
}
}
}