Skip to content

Commit

Permalink
Merge pull request #385 from KumbiaPHP/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
joanhey committed Feb 14, 2024
2 parents 3c621c6 + 8c84635 commit d34aa24
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/extensions/helpers/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
Expand Down Expand Up @@ -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}}</$tag>" : '/>';
// 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");
}
Expand Down Expand Up @@ -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) ? '' :
'<option value="">' . htmlspecialchars($blank, ENT_COMPAT, APP_CHARSET) . '</option>';
Expand Down Expand Up @@ -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"';
Expand All @@ -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"';
Expand Down Expand Up @@ -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 "<input id=\"$id\" name=\"$name\" type=\"file\" $attrs/>";
}
Expand Down

0 comments on commit d34aa24

Please sign in to comment.