初始化项目
This commit is contained in:
32
application/common/validate/Book.php
Normal file
32
application/common/validate/Book.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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 Book extends \think\Validate{
|
||||
|
||||
protected $rule = array(
|
||||
'book_name' => 'require',
|
||||
'stand_class' => 'require',
|
||||
);
|
||||
|
||||
protected $message = array(
|
||||
'book_name' => '书名称必须!',
|
||||
'stand_class' => '图书标准类型必须!',
|
||||
);
|
||||
|
||||
protected $scene = array(
|
||||
'add' => array('book_name', 'stand_class'),
|
||||
'edit' => array('book_name', 'stand_class')
|
||||
);
|
||||
|
||||
}
|
||||
33
application/common/validate/Config.php
Normal file
33
application/common/validate/Config.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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 Config extends \think\Validate{
|
||||
|
||||
protected $rule = array(
|
||||
'name' => 'require|unique',
|
||||
'title' => 'require',
|
||||
);
|
||||
|
||||
protected $message = array(
|
||||
'name.require' => '配置标识必须',
|
||||
'name.unique' => '配置标识已经存在',
|
||||
'title' => '配置名称必须',
|
||||
);
|
||||
|
||||
protected $scene = array(
|
||||
'add' => array('name', 'title'),
|
||||
'edit' => array('title')
|
||||
);
|
||||
|
||||
}
|
||||
26
application/common/validate/Member.php
Normal file
26
application/common/validate/Member.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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 Member extends \think\Validate{
|
||||
|
||||
protected $rule = array(
|
||||
'username' => 'require|unique:member|/^[a-zA-Z]\w{0,39}$/',
|
||||
);
|
||||
protected $message = array(
|
||||
'username.require' => '用户名必须',
|
||||
'username.unique' => '用户名已存在',
|
||||
);
|
||||
protected $scene = array();
|
||||
|
||||
}
|
||||
33
application/common/validate/Model.php
Normal file
33
application/common/validate/Model.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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 \think\Validate{
|
||||
|
||||
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',
|
||||
);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user