mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Add UIBlocks to twig (DataTable, Form, Input)
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user