phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlImage.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
17 
18  public function __construct($identifier, $src="", $alt="", $size=NULL) {
19  $image=new HtmlImg("img-", $src, $alt);
20  $image->setClass("");
21  parent::__construct($identifier, "div", "ui image", $image);
22  if (isset($size))
23  $this->setSize($size);
24  }
25 
26  public function setCircular() {
27  return $this->addToProperty("class", "circular");
28  }
29 
30  public function asAvatar($caption=NULL) {
31  if (isset($caption))
32  $this->wrap("", $caption);
33  return $this->addToProperty("class", "avatar");
34  }
35 
36  public static function small($identifier, $src="", $alt="") {
37  return new HtmlImage($identifier, $src, $alt, Size::SMALL);
38  }
39 
40  public static function avatar($identifier, $src="", $caption=NULL) {
41  $img=new HtmlImage($identifier, $src);
42  return $img->asAvatar($caption);
43  }
44 }
addToProperty($name, $value, $separator=" ")
wrap($before, $after="")
Definition: BaseHtml.php:171
static avatar($identifier, $src="", $caption=NULL)
Definition: HtmlImage.php:40
Semantic Image component.
Definition: HtmlImage.php:16
static small($identifier, $src="", $alt="")
Definition: HtmlImage.php:36
__construct($identifier, $src="", $alt="", $size=NULL)
Definition: HtmlImage.php:18
Base class for Semantic double elements.