自定义表单功能(X)
This commit is contained in:
29
application/common/validate/Form.php
Normal file
29
application/common/validate/Form.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
*/
|
||||
class Form extends Base {
|
||||
protected $rule = array(
|
||||
'title' => 'require',
|
||||
'name' => 'require|unique:form|/^[a-zA-Z]\w{0,39}$/',
|
||||
);
|
||||
|
||||
protected $message = array(
|
||||
'title.require' => '字段标题不能为空!',
|
||||
);
|
||||
|
||||
protected $scene = array(
|
||||
'add' => 'title',
|
||||
'edit' => 'title'
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user