功能模块构建
This commit is contained in:
16
app/controller/api/Wechat.php
Normal file
16
app/controller/api/Wechat.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?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\controller\api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 微信功能
|
||||||
|
*/
|
||||||
|
class Wechat extends Base {
|
||||||
|
|
||||||
|
}
|
||||||
57
app/controller/front/Content.php
Normal file
57
app/controller/front/Content.php
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?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\controller\front;
|
||||||
|
|
||||||
|
use \app\model\Category;
|
||||||
|
use \app\model\Model;
|
||||||
|
use \app\model\Content as ContentModel;
|
||||||
|
|
||||||
|
class Content extends Base {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 内容频道页
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function index() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 内容列表
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function lists() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 内容专题
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function topic() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 内容搜索
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function search() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 内容详情
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function detail() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
40
app/controller/front/Form.php
Normal file
40
app/controller/front/Form.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?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\controller\front;
|
||||||
|
|
||||||
|
use \app\model\Form as FormModel;
|
||||||
|
use \app\model\FormAttr;
|
||||||
|
|
||||||
|
class Form extends Base {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 表单页
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function index(){
|
||||||
|
if($this->request->isAjax()){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$id = $this->request->param('id');
|
||||||
|
$name = $this->request->param('name');
|
||||||
|
|
||||||
|
$map = [];
|
||||||
|
|
||||||
|
$map[] = ['id', '=', $id];
|
||||||
|
|
||||||
|
$info = Form::where($map)->find();
|
||||||
|
|
||||||
|
$this->data = [
|
||||||
|
'info' => $info
|
||||||
|
];
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,33 +8,13 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
namespace app\controller\front;
|
namespace app\controller\front;
|
||||||
|
|
||||||
use \app\model\Form;
|
|
||||||
|
|
||||||
|
|
||||||
class Index extends Base {
|
class Index extends Base {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 网站首页
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
public function index() {
|
public function index() {
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function form(){
|
|
||||||
if($this->request->isAjax()){
|
|
||||||
|
|
||||||
}else{
|
|
||||||
$id = $this->request->param('id');
|
|
||||||
$name = $this->request->param('name');
|
|
||||||
|
|
||||||
$map = [];
|
|
||||||
|
|
||||||
$map[] = ['id', '=', $id];
|
|
||||||
|
|
||||||
$info = Form::where($map)->find();
|
|
||||||
|
|
||||||
|
|
||||||
$this->data = [
|
|
||||||
'info' => $info
|
|
||||||
];
|
|
||||||
return $this->fetch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
51
app/controller/user/Content.php
Normal file
51
app/controller/user/Content.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?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\controller\user;
|
||||||
|
|
||||||
|
class Content extends Base {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 内容首页
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function index() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 添加内容
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function add() {
|
||||||
|
if ($this->request->isPost()) {
|
||||||
|
# code...
|
||||||
|
}else{
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 修改内容
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function add() {
|
||||||
|
if ($this->request->isPost()) {
|
||||||
|
# code...
|
||||||
|
}else{
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 删除内容
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function del() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,9 +9,9 @@
|
|||||||
namespace app\controller\user;
|
namespace app\controller\user;
|
||||||
|
|
||||||
class Index extends Base {
|
class Index extends Base {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 用户中心首页
|
* @title 用户首页
|
||||||
* @return [type] [description]
|
* @return [type] [description]
|
||||||
*/
|
*/
|
||||||
public function index() {
|
public function index() {
|
||||||
@@ -19,34 +19,10 @@ class Index extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 用户登录
|
* @title 个人资料
|
||||||
* @return [type] [description]
|
* @return [type] [description]
|
||||||
*/
|
*/
|
||||||
public function login() {
|
public function profile() {
|
||||||
return $this->fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @title 用户退出
|
|
||||||
* @return [type] [description]
|
|
||||||
*/
|
|
||||||
public function logout() {
|
|
||||||
return $this->fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @title 用户注册
|
|
||||||
* @return [type] [description]
|
|
||||||
*/
|
|
||||||
public function register() {
|
|
||||||
return $this->fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @title 忘记密码
|
|
||||||
* @return [type] [description]
|
|
||||||
*/
|
|
||||||
public function forget() {
|
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +30,15 @@ class Index extends Base {
|
|||||||
* @title 重置密码
|
* @title 重置密码
|
||||||
* @return [type] [description]
|
* @return [type] [description]
|
||||||
*/
|
*/
|
||||||
public function resetpasswd() {
|
public function repasswd() {
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* @title 上传头像
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function avatar() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
52
app/controller/user/Login.php
Normal file
52
app/controller/user/Login.php
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?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\controller\user;
|
||||||
|
|
||||||
|
class Login extends Base {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 用户登录
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function index() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 用户退出
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function logout() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 用户注册
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function register() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 忘记密码
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function forget() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 重置密码
|
||||||
|
* @return [type] [description]
|
||||||
|
*/
|
||||||
|
public function resetpasswd() {
|
||||||
|
return $this->fetch();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user