1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ajax\semantic\html\elements; |
4
|
|
|
|
5
|
|
|
use Ajax\semantic\html\base\HtmlSemDoubleElement; |
6
|
|
|
use Ajax\common\html\html5\HtmlImg; |
7
|
|
|
use Ajax\common\html\HtmlDoubleElement; |
8
|
|
|
use Ajax\semantic\html\base\constants\Direction; |
9
|
|
|
use Ajax\semantic\html\base\traits\LabeledIconTrait; |
10
|
|
|
|
11
|
|
|
class HtmlLabel extends HtmlSemDoubleElement { |
12
|
|
|
use LabeledIconTrait; |
13
|
|
|
public function __construct($identifier,$caption="",$tagName="div") { |
14
|
|
|
parent::__construct($identifier,$tagName,"ui label"); |
15
|
|
|
$this->content=$caption; |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @param string $side |
|
|
|
|
20
|
|
|
* @return \Ajax\semantic\html\elements\HtmlLabel |
21
|
|
|
*/ |
22
|
|
|
public function setPointing($value=Direction::NONE){ |
23
|
|
|
return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing")); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @param string $side |
28
|
|
|
* @return \Ajax\semantic\html\elements\HtmlLabel |
29
|
|
|
*/ |
30
|
|
|
public function toCorner($side="left"){ |
31
|
|
|
return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner")); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @return \Ajax\semantic\html\elements\HtmlLabel |
36
|
|
|
*/ |
37
|
|
|
public function asTag(){ |
38
|
|
|
return $this->addToProperty("class", "tag"); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @return \Ajax\semantic\html\elements\HtmlLabel |
43
|
|
|
*/ |
44
|
|
|
public function asLink(){ |
45
|
|
|
return $this->setTagName("a"); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function setBasic(){ |
49
|
|
|
return $this->addToProperty("class", "basic"); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Adds an image to emphasize |
54
|
|
|
* @param string $src |
55
|
|
|
* @param string $alt |
56
|
|
|
* @param string $before |
57
|
|
|
* @return \Ajax\semantic\html\elements\HtmlLabel |
58
|
|
|
*/ |
59
|
|
|
public function addImage($src,$alt="",$before=true){ |
60
|
|
|
$this->addToProperty("class", "image"); |
61
|
|
|
return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before); |
|
|
|
|
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @param string $detail |
66
|
|
|
* @return \Ajax\common\html\HtmlDoubleElement |
67
|
|
|
*/ |
68
|
|
View Code Duplication |
public function addDetail($detail){ |
|
|
|
|
69
|
|
|
$div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName); |
70
|
|
|
$div->setClass("detail"); |
71
|
|
|
$div->setContent($detail); |
72
|
|
|
$this->addContent($div); |
73
|
|
|
return $div; |
74
|
|
|
} |
75
|
|
|
} |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.