1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* FlashMessenger view helper styled for Bootstrap 3. |
5
|
|
|
* |
6
|
|
|
* @author Leandro Silva <[email protected]> |
7
|
|
|
* |
8
|
|
|
* @category LosUi |
9
|
|
|
* |
10
|
|
|
* @license https://github.com/Lansoweb/LosUi/blob/master/LICENSE MIT License |
11
|
|
|
* |
12
|
|
|
* @link http://github.com/LansoWeb/LosUi |
13
|
|
|
*/ |
14
|
|
|
namespace LosUi\View\Helper; |
15
|
|
|
|
16
|
|
|
use Zend\Mvc\Controller\Plugin\FlashMessenger as PluginFlashMessenger; |
17
|
|
|
use Zend\View\Helper\FlashMessenger as ZfFlashMessenger; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* FlashMessenger view helper styled for Bootstrap 3. |
21
|
|
|
* |
22
|
|
|
* @author Leandro Silva <[email protected]> |
23
|
|
|
* |
24
|
|
|
* @category LosUi |
25
|
|
|
* |
26
|
|
|
* @license https://github.com/Lansoweb/LosUi/blob/master/LICENSE MIT License |
27
|
|
|
* |
28
|
|
|
* @link http://github.com/LansoWeb/LosUi |
29
|
|
|
*/ |
30
|
|
|
class FlashMessenger extends ZfFlashMessenger |
|
|
|
|
31
|
|
|
{ |
32
|
|
|
protected $classMessages = [ |
33
|
|
|
PluginFlashMessenger::NAMESPACE_INFO => 'alert alert-dismissable alert-info', |
34
|
|
|
PluginFlashMessenger::NAMESPACE_ERROR => 'alert alert-dismissable alert-danger', |
35
|
|
|
PluginFlashMessenger::NAMESPACE_SUCCESS => 'alert alert-dismissable alert-success', |
36
|
|
|
PluginFlashMessenger::NAMESPACE_DEFAULT => 'alert alert-dismissable alert-default', |
37
|
|
|
PluginFlashMessenger::NAMESPACE_WARNING => 'alert alert-dismissable alert-warning', |
38
|
|
|
]; |
39
|
|
|
|
40
|
|
|
protected $messageCloseString = '</li></ul></div>'; |
41
|
|
|
|
42
|
|
|
protected $messageOpenFormat = '<div%s> |
43
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true"> |
44
|
|
|
× |
45
|
|
|
</button> |
46
|
|
|
<ul><li>'; |
47
|
|
|
|
48
|
|
|
protected $messageSeparatorString = '</li><li>'; |
49
|
|
|
|
50
|
|
|
public function renderAll($order = ['error', 'success', 'info', 'warning', 'default']) |
51
|
|
|
{ |
52
|
|
|
$html = ''; |
53
|
|
|
foreach ($order as $namespace) { |
54
|
|
|
$html .= $this->renderCurrent($namespace); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
return $html; |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.