Add UIBlocks to twig (WIP)

This commit is contained in:
Eric
2021-01-13 16:35:01 +01:00
parent 2b798baffc
commit 77808ecd41
23 changed files with 929 additions and 154 deletions

View File

@@ -46,6 +46,8 @@ class Field extends UIBlock
protected $sValueRaw;
/** @var string */
protected $sLabel;
/** @var string */
protected $sValueId;
/**
* Could be Input, but we have legacy code that needs to set raw HTML !
*
@@ -60,6 +62,7 @@ class Field extends UIBlock
parent::__construct($sId);
$this->sLabel = $sLabel;
$this->oValue = $oValue;
$this->sValueId = null;
}
/**
@@ -341,4 +344,24 @@ class Field extends UIBlock
return $this;
}
/**
* @return string
*/
public function GetValueId(): ?string
{
return $this->sValueId;
}
/**
* @param string|null $sValueId
*
* @return $this
*/
public function SetValueId(?string $sValueId)
{
$this->sValueId = $sValueId;
return $this;
}
}

View File

@@ -71,4 +71,20 @@ class FieldFactory
return $oField;
}
public static function MakeLarge(string $sLabel, $sValueHtml)
{
$oField = new Field($sLabel, new Html($sValueHtml));
$oField->SetLayout(Field::ENUM_FIELD_LAYOUT_LARGE);
return $oField;
}
public static function MakeSmall(string $sLabel, $sValueHtml)
{
$oField = new Field($sLabel, new Html($sValueHtml));
$oField->SetLayout(Field::ENUM_FIELD_LAYOUT_SMALL);
return $oField;
}
}