Ubiquity  2.0.3
php rapid development framework
FlashMessage.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Ubiquity\utils\flash;
4 
5 class FlashMessage {
6  protected $title;
7  protected $content;
8  protected $type;
9  protected $icon;
10 
11  public function __construct($content,$title=NULL,$type="info",$icon=null){
13  }
14 
15  public function setValues($content,$title=NULL,$type=NULL,$icon=null){
16  if(isset($type))
17  $this->type=$type;
18  $this->content=$content;
19  if(isset($icon))
20  $this->icon=$icon;
21  if(isset($title))
22  $this->title=$title;
23  }
27  public function getContent() {
28  return $this->content;
29  }
30 
34  public function getType() {
35  return $this->type;
36  }
37 
41  public function getIcon() {
42  return $this->icon;
43  }
44 
48  public function setContent($content) {
49  $this->content = $content;
50  }
51 
55  public function setType($type) {
56  $this->type = $type;
57  }
58 
59  public function addType($type){
60  $this->type.=" ".$type;
61  }
62 
66  public function setIcon($icon) {
67  $this->icon = $icon;
68  }
72  public function getTitle() {
73  return $this->title;
74  }
75 
79  public function setTitle($title) {
80  $this->title = $title;
81  }
82 
83  public function parseContent($keyValues){
84  $msg=$this->content;
85  foreach ($keyValues as $key=>$value){
86  $msg=str_replace("{".$key."}", $value, $msg);
87  }
88  $this->content=$msg;
89  return $this;
90  }
91 
92 
93 }
94 
__construct($content, $title=NULL, $type="info", $icon=null)
setValues($content, $title=NULL, $type=NULL, $icon=null)