📄 softcontroller.php
字号:
<?php
class SoftController extends Easy_Controller_Action {
public function Init(){
$this->_Soft = new SoftModel();
}
public function IndexAction(){
$this->_View->soft = $this->_Soft->getAll();
}
public function addAction(){
if ($this->_Request->isPost()){
if ($this->_Soft->add($this->_Request->getPost()) ===false){
$this->_View->message = $this->_Soft->error;
}else{
$this->_View->message = _('添加成功!');
}
exit($this->_View->Render('message'));
}
}
public function modifyAction(){
if ($this->_Request->isPost()){
if ($this->_Soft->modify($this->_Request->getPost())===false){
$this->_View->message = $this->_Soft->error;
}else{
$this->_View->message = _('修改成功!');
}
exit($this->_View->Render('message'));
}else{
$this->_View->modify = $this->_Soft->getRow((int)$this->_Request->getParam('id'));
}
}
public function deleteAction(){
$this->_Soft->delete($this->_Request->getParam('id'));
$this->_View->message = _('删除成功!');
exit($this->_View->Render('message'));
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -