更新目录结构
This commit is contained in:
36
app/model/system/Rewrite.php
Normal file
36
app/model/system/Rewrite.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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\model\system;
|
||||
|
||||
/**
|
||||
* 伪静态
|
||||
*/
|
||||
class Rewrite extends \think\Model {
|
||||
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
public static $keyList = array(
|
||||
array('name' => 'id', 'title' => '标识', 'type' => 'hidden'),
|
||||
array('name' => 'rule', 'title' => '规则名称', 'type' => 'text', 'is_must'=> true, 'option' => '', 'help' => '规则名称,方便记忆'),
|
||||
array('name' => 'url', 'title' => '规则地址', 'type' => 'text', 'is_must'=> true, 'option' => '', 'help' => '规则地址'),
|
||||
);
|
||||
|
||||
/**
|
||||
* 数据修改
|
||||
* @return [bool] [是否成功]
|
||||
*/
|
||||
public function change() {
|
||||
$data = \think\Request::instance()->post();
|
||||
if (isset($data['id']) && $data['id']) {
|
||||
return $this->validate(true)->save($data, array('id' => $data['id']));
|
||||
} else {
|
||||
return $this->validate(true)->save($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user