syntax error, unexpected ';', expecting T_FUNCTION
错误位置
FILE: C:\AppServ\www\test\App\Lib\Action\FormAction.class.php LINE: 21
这个一般是什么错误··没搞懂
以下是代码
class FormAction extends Action{
public function insert(){
$Form = D('Form');
if($Form->create()) {
$result = $Form->add();
if($result) {
$this->success('操作成功!');
}else{
$this->error('写入错误!');
}
}else{
$this->error($Form->getError());
}
}
public function read($id=0){
$Form = M('Form');
// 读取数据
$data = $Form->find($id);
if($data) {
$this->data = $data;// 模板变量赋值
}else{
$this->error('数据错误');
}
$this->display();
}
public function edit($id=0){
$Form = M('Form');
$this->vo = $Form->find($id);
$this->display();
}
public function update(){
$Form = D('Form');
if($Form->create()) {
$result = $Form->save();
if($result) {
$this->success('操作成功!');
}else{
$this->error('写入错误!');
}
}else{
$this->error($Form->getError());
}
}
} 最佳答案