Form.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // |
  4. // +----------------------------------------------------------------------
  5. // |
  6. // +----------------------------------------------------------------------
  7. // |
  8. // +----------------------------------------------------------------------
  9. // |
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | 表单生成门面类 https://github.com/LaravelCollective/html
  13. // +----------------------------------------------------------------------
  14. namespace form;
  15. use think\Facade;
  16. /**
  17. * @see \form\FormBuilder
  18. * @method string label($name, $value = null, $options = [], $escape_html = true) static 创建一个表单标签元素
  19. * @method string input($type, $name, $value = null, $options = []) static 创建一个表单输入字段
  20. * @method string text($name, $value = null, $options = []) static 创建一个文本输入字段
  21. * @method string password(string $name, array $options = []) static 创建一个密码输入字段
  22. * @method string range($name, $value = null, $options = []) static 创建一个范围输入选择器
  23. * @method string hidden($name, $value = null, $options = []) static 创建一个隐藏的输入字段
  24. * @method string email($name, $value = null, $options = []) static 创建一个电子邮件输入字段
  25. * @method string tel($name, $value = null, $options = []) static 创建一个tel输入字段
  26. * @method string number($name, $value = null, $options = []) static 创建一个数字输入字段
  27. * @method string url($name, $value = null, $options = []) static 创建一个url输入字段
  28. * @method string textarea($name, $value = null, $options = []) static 创建一个textarea输入字段
  29. * @method string select($name,$list = [],$selected = null,array $selectAttributes = [],array $optionsAttributes = [],array $optgroupsAttributes = []) static 创建一个选择框字段
  30. * @method string button($value = null, $options = []) static 创建一个按钮字段
  31. * @method string image($name = null, $value = null, $inputAttr = [], $uploadAttr = [], $chooseAttr = [], $previewAttr = []) static 创建一个上传图片组件(单图)字段
  32. * @method string images($name = null, $value = null, $inputAttr = [], $uploadAttr = [], $chooseAttr = [], $previewAttr = []) static 创建一个上传图片组件(多图)字段
  33. * @method string radio($name, $value = null, $checked = null, $options = []) static 创建单选按钮输入字段
  34. * @method string radios($name, $list, $checked = null, $title = [], $options = []) static 创建一组单选框字段
  35. * @method string checkbox($name, $value = 1, $checked = null, $options = []) static 创建复选按钮字段
  36. * @method string checkboxs($name, $list, $checked, $title = [], $options = []) static 创建一组复选按钮框字段
  37. * @method string upload($name = null, $value = null, $inputAttr = [], $uploadAttr = [], $chooseAttr = [], $previewAttr = []) static 创建上传文件组件(单文件)字段
  38. * @method string uploads($name = null, $value = null, $inputAttr = [], $uploadAttr = [], $chooseAttr = [], $previewAttr = []) static 创建上传文件组件(多文件)字段
  39. * @method string color($name = null, $value = null, $options = []) static 创建颜色选择字段
  40. * @method string datetime($name = null, $value = null, $options = []) static 创建日期时间选择器字段
  41. * @method string ueditor($name, $value = null, $options = []) static 创建百度富文本编辑器字段
  42. * @method string selectpage($name, $value, $url, $field = null, $primaryKey = null, $options = []) static 创建动态下拉列表字段
  43. * @method string selectpages($name, $value, $url, $field = null, $primaryKey = null, $options = []) static 创建动态下拉列表(复选)字段
  44. */
  45. class Form extends Facade
  46. {
  47. /**
  48. * 获取当前Facade对应类名(或者已经绑定的容器对象标识)
  49. * @access protected
  50. * @return string
  51. */
  52. protected static function getFacadeClass()
  53. {
  54. return 'form\FormBuilder';
  55. }
  56. }