zvcore缓存增加saveCache方法
|
<?php /** * path:./controllers/testAction.class.php */ class testAction extends Action { public function index() { $this->_cacheThis=true; $this->_cacheTime=2; //初始化数据模型 $userModel = App::Model(‘user’); //预备插入的数据 $data = array(‘username’=>"swiden", ‘password’=>"genpark", ‘trueName’=>"nicework"); //开始强力插入 $insId = $userModel->insertTable($data); //试图显示插入结果 echo "你现在插入了一个id为".$insId."的记录!<br />"; echo "现在取出数据!<br />"; //开始变魔术了 helper::dump($userModel->findById($insId)); echo "现在删除数据!<br />"; //玩完了。 var_dump($userModel->deleteByusername($data['username'])); $this->saveCache(); } }
|



