您需要使用创建一个对象
new,以便有一个
$this对象:
$chat = new Chat($row);$chat->Send(array( 'message' => Input::get('message'), 'author' => $user->data()->username, 'ts' => date('Y-m-d H:i:s')));在调用构造函数之前,您不会创建数据库连接,而在
new使用构造函数时会发生这种情况。

您需要使用创建一个对象
new,以便有一个
$this对象:
$chat = new Chat($row);$chat->Send(array( 'message' => Input::get('message'), 'author' => $user->data()->username, 'ts' => date('Y-m-d H:i:s')));在调用构造函数之前,您不会创建数据库连接,而在
new使用构造函数时会发生这种情况。