Add UIBlocks to twig (DataTable, Form, Input)

This commit is contained in:
Eric
2021-01-14 13:14:05 +01:00
parent e51fd028fa
commit d8316a090a
21 changed files with 434 additions and 212 deletions

View File

@@ -26,6 +26,32 @@ class InputFactory
return $oInput;
}
public static function MakeStandard(string $sType, string $sName, string $sValue, ?string $sId = null): Input
{
$oInput = new Input($sId);
$oInput->SetType($sType)
->SetName($sName)
->SetValue($sValue);
return $oInput;
}
public static function MakeWithLabel(string $sType, string $sLabel, string $sName, string $sValue, ?string $sId = null): InputWithLabel
{
$oInput = new Input($sId);
$oInput->SetType($sType)
->SetName($sName)
->SetValue($sValue);
if (is_null($sId)) {
$sId = $oInput->GetId();
}
return new InputWithLabel($sLabel, $oInput, $sId);
}
/**
* @see Field component that is better adapter when dealing with a standard iTop form
*