Skip to content

Commit

Permalink
Merge pull request #4507 from totoprayogo1916/form_reset
Browse files Browse the repository at this point in the history
make form_submit() & form_reset() based on form_input()
  • Loading branch information
paulbalandan authored Mar 30, 2021
2 parents 5c23a60 + 220a852 commit c6f60fe
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions system/Helpers/form_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,7 @@ function form_radio($data = '', string $value = '', bool $checked = false, $extr
*/
function form_submit($data = '', string $value = '', $extra = ''): string
{
$defaults = [
'type' => 'submit',
'name' => is_array($data) ? '' : $data,
'value' => $value,
];

return '<input ' . parse_form_attributes($data, $defaults) . stringify_attributes($extra) . " />\n";
return form_input($data, $value, $extra, 'submit');
}
}

Expand All @@ -546,13 +540,7 @@ function form_submit($data = '', string $value = '', $extra = ''): string
*/
function form_reset($data = '', string $value = '', $extra = ''): string
{
$defaults = [
'type' => 'reset',
'name' => is_array($data) ? '' : $data,
'value' => $value,
];

return '<input ' . parse_form_attributes($data, $defaults) . stringify_attributes($extra) . " />\n";
return form_input($data, $value, $extra, 'reset');
}
}

Expand Down

0 comments on commit c6f60fe

Please sign in to comment.