Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
FlashMessage.php
Go to the documentation of this file.
1<?php
2
4
6 protected ?string $title;
7 protected ?string $content;
8 protected ?string $type;
9 protected ?string $icon;
10
11 public function __construct(string $content,string $title=NULL,string $type='info',string $icon=null){
12 $this->setValues($content,$title,$type,$icon);
13 }
14
15 public function setValues(string $content,string $title=NULL,string $type=NULL,string $icon=null){
16 $this->type = $type;
17 $this->content=$content;
18 $this->icon = $icon;
19 $this->title = $title;
20 }
24 public function getContent(): ?string {
25 return $this->content;
26 }
27
31 public function getType(): ?string {
32 return $this->type;
33 }
34
38 public function getIcon(): ?string {
39 return $this->icon;
40 }
41
45 public function setContent(string $content) {
46 $this->content = $content;
47 }
48
52 public function setType(string $type) {
53 $this->type = $type;
54 }
55
56 public function addType(string $type){
57 $this->type.=' '.$type;
58 }
59
63 public function setIcon(string $icon) {
64 $this->icon = $icon;
65 }
69 public function getTitle(): ?string {
70 return $this->title;
71 }
72
76 public function setTitle(string $title) {
77 $this->title = $title;
78 }
79
80 public function parseContent(array $keyValues): self {
81 $msg=$this->content;
82 foreach ($keyValues as $key=>$value){
83 $msg=\str_replace('{'.$key.'}', $value, $msg);
84 }
85 $this->content=$msg;
86 return $this;
87 }
88}
__construct(string $content, string $title=NULL, string $type='info', string $icon=null)
setValues(string $content, string $title=NULL, string $type=NULL, string $icon=null)