add and use new attribute for the length of the Entries

This commit is contained in:
Beu
2023-07-10 17:12:57 +02:00
parent 8c478084a2
commit 13965aef03
4 changed files with 51 additions and 44 deletions

View File

@ -48,6 +48,11 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
*/
protected $autoNewLine = null;
/**
* @var string $maxLength Text format
*/
protected $maxLength = null;
/**
* @var string $textFormat Text format
*/
@ -192,6 +197,30 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
return $this;
}
/**
* Get text format
*
* @api
* @return int
*/
public function getMaxLength()
{
return $this->maxLength;
}
/**
* Set text format
*
* @api
* @param int $maxLength Max Length
* @return static
*/
public function setMaxLength($maxLength)
{
$this->maxLength = $maxLength;
return $this;
}
/**
* Get text format
*
@ -443,6 +472,9 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
if ($this->selectText) {
$domElement->setAttribute("selecttext", 1);
}
if ($this->maxLength) {
$domElement->setAttribute("maxlen", $this->maxLength);
}
if ($this->autoNewLine) {
$domElement->setAttribute("autonewline", 1);
}