); protected functiongetId(){ return $_SESSION['id']; } } ?> 二:控制器中 class MessageAction extends Action{ public function doLiuyan(){ $message=D('Message'); //$message->time=time(); //$message->uid=$_SESSION['id']; 这2个值将在自定义MessageModel中自动填充完成
$message->add(); //返回值是新增的id号 } } ?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn