UrlRule.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%url_rule}}".
  6. *
  7. * @property int $id ID
  8. * @property string $unique_no 唯一标识符
  9. * @property string $bak 备注
  10. * @property string $type 规则类型
  11. * @property int $is_html 生成HTML
  12. * @property string $from_rule URL规则
  13. * @property string $to_rule 请求处理方式
  14. * @property string $args 参数
  15. * @property string $example 示例
  16. * @property int $is_system 系统规则
  17. * @property int $list_order 排序
  18. */
  19. class UrlRule extends \app\common\models\EActiveRecord
  20. {
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public static function tableName()
  25. {
  26. return '{{%url_rule}}';
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function rules()
  32. {
  33. return [
  34. [['is_html', 'is_system', 'list_order'], 'integer'],
  35. [['from_rule', 'to_rule', 'example'], 'required'],
  36. [['unique_no', 'bak'], 'string', 'max' => 50],
  37. [['type'], 'string', 'max' => 20],
  38. [['from_rule', 'to_rule', 'args'], 'string', 'max' => 500],
  39. [['example'], 'string', 'max' => 255],
  40. ];
  41. }
  42. /**
  43. * {@inheritdoc}
  44. */
  45. public function attributeLabels()
  46. {
  47. return [
  48. 'id' => 'ID',
  49. 'unique_no' => '唯一标识符',
  50. 'bak' => '备注',
  51. 'type' => '规则类型',
  52. 'is_html' => '生成HTML',
  53. 'from_rule' => 'URL规则',
  54. 'to_rule' => '请求处理方式',
  55. 'args' => '参数',
  56. 'example' => '示例',
  57. 'is_system' => '系统规则',
  58. 'list_order' => '排序',
  59. ];
  60. }
  61. }