cate.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'cate',
  6. # 显示给用户看的名称
  7. 'lang' => '文章分类',
  8. # 后台菜单排序
  9. 'order' => 9,
  10. 'menu' => false,
  11. # 数据结构
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. 'search' => 'order',
  22. 'list' => true,
  23. 'order' => 'desc',
  24. ),
  25. 'name' => array
  26. (
  27. 'type' => 'varchar-32',
  28. 'name' => '分类名称',
  29. 'default' => '',
  30. 'desc' => '请输入名称',
  31. 'match' => 'is_string',
  32. 'update' => 'text',
  33. 'search' => 'fulltext',
  34. 'list' => true,
  35. ),
  36. 'reorder' => array
  37. (
  38. 'type' => 'int-11',
  39. 'name' => '排序(数值越大越靠前)',
  40. 'default' => '1',
  41. 'desc' => '请输入排序',
  42. 'match' => 'option',
  43. 'update' => 'text',
  44. 'search' => 'order',
  45. 'list' => true,
  46. 'order' => 'desc',
  47. 'edit' => true,
  48. ),
  49. 'state' => array
  50. (
  51. 'type' => 'tinyint-1',
  52. 'name' => '状态',
  53. 'default' => '1',
  54. 'desc' => '请选择状态',
  55. 'match' => 'is_numeric',
  56. ),
  57. 'cdate' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '录入时间',
  61. 'match' => array('is_numeric', time()),
  62. 'desc' => '',
  63. # 只有insert时才生效
  64. 'insert' => true,
  65. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  66. ),
  67. ),
  68. # 默认值
  69. 'default' => array
  70. (
  71. 'col' => 'name,reorder,cdate',
  72. 'value' => array
  73. (
  74. '"默认分类",100,' . time(),
  75. ),
  76. ),
  77. 'manage' => array
  78. (
  79. 'insert' => false,
  80. 'edit' => false,
  81. # 自定义快捷新增和编辑
  82. 'button' => array
  83. (
  84. '新增' => array('fast'),
  85. ),
  86. # 快捷更新
  87. 'list_button' => array
  88. (
  89. 'edit' => array('编辑'),
  90. ),
  91. ),
  92. 'request' => array
  93. (
  94. 'getAll' => array
  95. (
  96. # 匹配的正则或函数 选填项
  97. 'option' => array
  98. (
  99. 'state' => 1,
  100. ),
  101. 'type' => 'all',
  102. 'order' => array('reorder' => 'desc','id' => 'desc'),
  103. 'col' => '*',
  104. ),
  105. ),
  106. );