phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlLink.php
Go to the documentation of this file.
1 <?php
2 
4 
8 use Ajax\JsUtils;
9 
11  use HtmlLinkTrait;
12 
13  public function __construct($identifier, $href="#", $content="Link",$target=NULL) {
14  parent::__construct($identifier, "a", "");
15  $this->setHref($href);
16  if(isset($target))
17  $this->setTarget($target);
18  $this->content=$content;
19  }
20 
21  /*
22  * (non-PHPdoc)
23  * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run()
24  */
25  public function run(JsUtils $js) {
26  $this->_bsComponent=$js->semantic()->generic("#" . $this->identifier);
27  $this->addEventsOnRun($js);
28  return $this->_bsComponent;
29  }
30 
31  public function addIcon($icon, $before=true) {
32  return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before);
33  }
34 
35  public static function icon($identifier, $icon, $href="#", $label=NULL) {
36  $result=new HtmlLink($identifier, $href, $label);
37  return $result->addIcon($icon);
38  }
39 }
setTarget($value="_self")
addContent($content, $before=false)
addEventsOnRun(JsUtils $js=NULL)
Semantic Icon component.
Definition: HtmlIcon.php:14
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