Files
sentcms/application/common/validate/Model.php
molong 783369c9e4 1、后台的一些bug修复
2、内核更新
3、后台的扩展模型做了一点更新一点,还不够完善
2016-07-19 14:08:00 +08:00

33 lines
1.0 KiB
PHP

<?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 Model extends Base{
protected $rule = array(
'name' => 'require|unique:model|/^[a-zA-Z]\w{0,39}$/',
'title' => 'require|length:1,30'
);
protected $message = array(
'name' => '模型名错误!',
'name.require' => '模型名必须!',
'name.unique' => '模型名已存在!',
'title.require' => '模型标题必须!',
'title.length' => '模型标题长度错误!',
);
protected $scene = array(
'add' => 'name,title',
'edit' => 'title',
);
}