Skip to content

Commit

Permalink
chore: Add Form class with text input function
Browse files Browse the repository at this point in the history
  • Loading branch information
yama committed Jun 30, 2024
1 parent 091c728 commit 02fc426
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions manager/actions/tool/mutate_settings/functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,18 @@ function settings()
}
return $settings;
}

class Form
{
public static function text($name, $value, $attr = array())
{
return sprintf(
strpos($value, '"') === false
? '<input type="text" name="%s" value="%s" %s>'
: '<input type="text" name="%s" value=\'%s\' %s>',
$name,
$value,
join_attr($attr)
);
}
}

0 comments on commit 02fc426

Please sign in to comment.