38 parent::__construct(
$identifier,
"form",
"ui form");
39 $this->_states=[ State::ERROR,State::SUCCESS,State::WARNING,State::DISABLED ];
41 $this->_fields=array ();
43 $this->_validationParams=[];
44 $this->_extraFieldRules=[];
57 public function addHeader($title, $niveau=1, $dividing=
true) {
60 $header->setDividing();
79 public function addFields($fields=NULL, $label=NULL) {
82 if (!\is_array($fields)) {
83 $fields=\func_get_args();
85 if (\is_string($end)) {
91 $this->_fields=\array_merge($this->_fields, $fields);
95 $fields->wrap(
"<div class='field'><label>{$label}</label>",
"</div>");
105 $item=parent::addItem($item);
106 if (\is_subclass_of($item, HtmlFormField::class) ===
true) {
107 $this->_fields[]=$item;
117 if (\is_string($index)) {
120 $field=$this->_fields[$index];
154 $message->addHeader($header);
156 $message->setIcon($icon);
158 $message->setStyle($type);
159 return $this->
addItem($message);
165 if(\
sizeof($this->_validationParams)>0)
167 return parent::compile($js,$view);
172 $compo=$js->
semantic()->form(
"#".$this->identifier);
175 $compo->attach(
"#".$this->identifier);
177 foreach ($this->_fields as $field){
182 foreach ($this->content as $field){
184 $items=$field->getItems();
185 foreach ($items as $_field){
191 foreach ($this->_extraFieldRules as $field=>$fieldValidation){
199 if(!isset($this->_extraFieldRules[$fieldname])){
202 return $this->_extraFieldRules[$fieldname];
206 $this->
addBehavior($this->_validationParams, $paramName, $paramValue,$before,$after);
224 unset($this->_validationParams[$param]);
semantic(Semantic $semantic=NULL)
getter or setter of the Semantic-UI variable
BaseHtml for HTML components.
getElementById($identifier, $elements)
Base class for Semantic Html collections.
addBehavior(&$array, $key, $value, $before="", $after="")
addToProperty($name, $value, $separator=" ")
addContent($content, $before=false)
setProperty($name, $value)
Semantic Message component.
Semantic UI divider component.