我在我的模型中使用此代码,
public function registration(){
$name = 'Foo';
$city = 'Bar';
$this->User->save(
array(
'name' => $name,
'city' => $city
)
);
}
但是在插入时出现致命错误
"Error: Call to a member function save() on a non-object
File: C:\xampp\htdocs\blogs\app\Model\User.php"
如何插入?