⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 softcontroller.php

📁 a short sketch about linux syntex lines.
💻 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 + -