📄 commentscontroller.php
字号:
<?php
class CommentsController extends Easy_Controller_Action {
public function Init(){
$this->_Comments = new CommentsModel();
}
public function IndexAction(){
$this->_View->connets = $this->_Comments->getList('locked=0');
$this->_View->printpage = $this->_Comments->printPage;
}
public function deleteAction(){
$id = (int)$this->_Request->getParam('id');
if ($id){
$this->_Comments->delete($id);
}
$this->_View->message = _('删除成功!');
exit($this->_View->render('message'));
}
public function lockedAction(){
$id = $this->_Request->getParam('id');
if ($id){
$this->_Comments->locked($id);
}
$this->_View->message = _('审核成功!');
exit($this->_View->render('message'));
}
public function postAction(){
$post = $this->_Request->getPost('post');
$id = $this->_Request->getParams('id');
if ($post == 'locked'){
$this->_Comments->locked($id);
$this->_View->message = _('审核成功!');
}elseif ($post == 'delete'){
$this->_Comments->delete($id);
$this->_View->message = _('删除成功!');
}
exit($this->_View->render('message'));
}
}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -