From 316d1a1de54446484f98ddcc75160443cb3afa76 Mon Sep 17 00:00:00 2001 From: Joanhey Date: Wed, 14 Feb 2024 11:58:39 +0100 Subject: [PATCH] Clean Form class --- core/extensions/helpers/form.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/extensions/helpers/form.php b/core/extensions/helpers/form.php index ce49b596..8f31655f 100644 --- a/core/extensions/helpers/form.php +++ b/core/extensions/helpers/form.php @@ -55,7 +55,7 @@ public static function getField($field, $value = null, $is_check = false, $filte { // Obtiene considerando el patrĂ³n de formato form.field $formField = explode('.', $field, 2); - list($id, $name) = self::fieldName($formField); + [$id, $name] = self::fieldName($formField); // Verifica en $_POST if (Input::hasPost($field)) { $value = $is_check ? @@ -161,12 +161,12 @@ public static function getFieldDataCheck($field, $checkValue, $checked = false) * @param string $value * @param string|array $attrs */ - protected static function tag($tag, $field, $attrs = '', $value = null, $extra = '', $close = true) + protected static function tag($tag, $field, $attrs = '', $value = '', $extra = '', $close = true) { $attrs = Tag::getAttrs($attrs); $end = $close ? ">{{value}}" : '/>'; // Obtiene name, id y value (solo para autoload) para el campo y los carga en el scope - list($id, $name, $value) = self::getFieldData($field, $value); + [$id, $name, $value] = self::getFieldData($field, $value); return str_replace('{{value}}', $value, "<$tag id=\"$id\" name=\"$name\" $extra $attrs $end"); } @@ -332,7 +332,7 @@ public static function select($field, $data, $attrs = '', $value = null, $blank { $attrs = Tag::getAttrs($attrs); // Obtiene name, id y value (solo para autoload) para el campo y los carga en el scope - list($id, $name, $value) = self::getFieldData($field, $value); + [$id, $name, $value] = self::getFieldData($field, $value); //Si se quiere agregar blank $options = empty($blank) ? '' : ''; @@ -408,7 +408,7 @@ public static function check($field, $checkValue, $attrs = '', $checked = false) { $attrs = Tag::getAttrs($attrs); // Obtiene name y id para el campo y los carga en el scope - list($id, $name, $checked) = self::getFieldDataCheck($field, $checkValue, $checked); + [$id, $name, $checked] = self::getFieldDataCheck($field, $checkValue, $checked); if ($checked) { $checked = 'checked="checked"'; @@ -431,7 +431,7 @@ public static function radio($field, $radioValue, $attrs = '', $checked = false) { $attrs = Tag::getAttrs($attrs); // Obtiene name y id para el campo y los carga en el scope - list($id, $name, $checked) = self::getFieldDataCheck($field, $radioValue, $checked); + [$id, $name, $checked] = self::getFieldDataCheck($field, $radioValue, $checked); if ($checked) { $checked = 'checked="checked"'; @@ -552,7 +552,7 @@ public static function file($field, $attrs = '') $attrs = Tag::getAttrs($attrs); // Obtiene name y id, y los carga en el scope - list($id, $name) = self::getFieldData($field, false); + [$id, $name] = self::getFieldData($field, false); return ""; }