public function run() { $this->mode = 'json'; $updateParams = array('where' => array('id' => array('value' => 1, 'op' => '=')), 'update' => array('name' => 'lichao', 'pwd' => 'helloworld')); $pc = new Test(); $ret = $pc->update($updateParams); print_r($ret); }
public function run() { $this->mode = 'html'; $queryData = array('fields' => array('id', 'name', 'pwd'), 'where' => array('id' => array('value' => 1, 'op' => '>='))); $pc = new Test(); $ret = $pc->query($queryData); //这个比较好的方法, 将变量放到Controller的一个私有变量中, //然后使用extract 函数将数组转化为display()的一个成员变量. //以便于展现. $this->extract('ret', $ret); }
public function run() { if (!$this->init()) { return FALSE; } $arr = array('name' => $this->name, 'pwd' => $this->pwd); $this->mode = "json"; $pc = new Test(); $ret = $pc->insert($arr); $this->view = $ret; }