N°2847 Refactor Inputs components

This commit is contained in:
Stephen Abello
2020-09-30 09:39:40 +02:00
parent c0337eaa23
commit 12bf77d9ca
8 changed files with 70 additions and 15 deletions

View File

@@ -8,12 +8,49 @@
namespace Combodo\iTop\Application\UI\Component\Input;
class InputWithLabel extends Input
use Combodo\iTop\Application\UI\UIBlock;
class InputWithLabel extends UIBlock
{
public const HTML_TEMPLATE_REL_PATH = 'components/input/inputwithlabel';
/** @var string */
protected $sLabel;
/** @var \Combodo\iTop\Application\UI\Component\Input\Input */
protected $oInput;
/**
* InputWithLabel constructor.
*
* @param string $sLabel
* @param \Combodo\iTop\Application\UI\Component\Input\Input $oInput
*/
public function __construct(string $sLabel, \Combodo\iTop\Application\UI\Component\Input\Input $oInput, ?string $sId)
{
parent::__construct($sId);
$this->sLabel = $sLabel;
$this->oInput = $oInput;
}
/**
* @return \Combodo\iTop\Application\UI\Component\Input\Input
*/
public function GetInput(): \Combodo\iTop\Application\UI\Component\Input\Input
{
return $this->oInput;
}
/**
* @param \Combodo\iTop\Application\UI\Component\Input\Input $oInput
*
* @return $this
*/
public function SetInput(\Combodo\iTop\Application\UI\Component\Input\Input $oInput): InputWithLabel
{
$this->oInput = $oInput;
return $this;
}
/**
* @return string