phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlToast.php
Go to the documentation of this file.
1 <?php
3 
5 use Ajax\JsUtils;
7 
17 
18  protected $_paramParts=array();
19 
20  public function __construct($identifier, $content='') {
21  parent::__construct($identifier, 'div','ui toast');
22  if(isset($content)){
23  $this->setContent($content);
24  }
25  }
26 
27  public function setContent($value) {
28  $this->content['content']=new HtmlSemDoubleElement('content-' . $this->identifier, 'div', 'content', $value);
29  return $this;
30  }
31 
38  public function compile(JsUtils $js=NULL, &$view=NULL) {
39  $this->content=JArray::sortAssociative($this->content, ['content','actions' ]);
40  return parent::compile($js, $view);
41  }
42 
43  /*
44  * (non-PHPdoc)
45  * @see BaseHtml::run()
46  */
47  public function run(JsUtils $js) {
48  if(isset($this->_bsComponent)===false){
49  $this->_bsComponent=$js->semantic()->toast('#'.$this->identifier,$this->_params,$this->_paramParts);
50  }
51  $this->addEventsOnRun($js);
52  return $this->_bsComponent;
53  }
54 }
55 
compile(JsUtils $js=NULL, &$view=NULL)
Definition: HtmlToast.php:38
__construct($identifier, $content='')
Definition: HtmlToast.php:20
addEventsOnRun(JsUtils $js=NULL)
Ajax$HtmlToast This class is part of phpMv-ui.
Definition: HtmlToast.php:16
semantic(Semantic $semantic=NULL)
getter or setter of the Semantic-UI variable
Definition: JsUtils.php:159
Base class for Semantic double elements.
JQuery PHP library.
Definition: JsUtils.php:23
static sortAssociative($array, $sortedKeys=array())
Definition: JArray.php:66