add and use new attribute for the length of the Entries
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user