123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace User\Controller;
- use Base\Controller\BaseController;
- use User\Model\UserModel;
- /**
- * 用户控制器
- * @author Superbee
- *
- */
- class UserController extends BaseController {
-
- private $userModel;
-
- public function _initialize(){
- parent::_initialize();
-
- $this->userModel = new UserModel();
- }
-
- public function index(){
- $page = I('get.page');
- $info = $this->userModel->getInfo($page);
- $p = $this->userModel->getPages();
-
- $this->assign("array", $info);
- $this->assign("page", $p);
- $this->display('index');
- }
-
- public function edit(){
- $id = I('get.id');
- $info = $this->userModel->getUserById($id);
- $action = ($info)?'update':'add';
-
- $this->assign('action', $action);
- $this->assign("info", $info);
- $this->display('edit');
- }
-
- public function update(){
-
- }
-
- public function remove(){
-
- }
- }
|