feat: Небольшой рефакторинг. Ограничение длинны значения в поле ввода

This commit is contained in:
origami11@yandex.ru 2024-12-05 12:48:08 +03:00
parent f599a68529
commit e5e0b6735f
5 changed files with 56 additions and 40 deletions

View file

@ -16,6 +16,7 @@ class Field
public $error = false;
public $require = false;
public $hint = null;
public $maxlength = null;
public $fieldset = null;
// Блоки (Убрать в отдельный класс!!!)
public $_title = array();
@ -33,7 +34,7 @@ class Field
$this->fieldset = $input['fieldset'];
}
// Инициализация свойст обьетка
foreach (['label', 'name', 'type', 'description'] as $name) {
foreach (['label', 'name', 'type', 'description', 'maxlength'] as $name) {
if (isset($input[$name])) {
$this->$name = $input[$name];
}