开发者

Storing the comment data from post view in yii

开发者 https://www.devze.com 2023-03-23 07:54 出处:网络
i can get the form of comment in the post by the following code.. <?php $comment= new Comment(); $this->renderPartial(\'/comment/_form\',array(\'model\'=>$comment,));

i can get the form of comment in the post by the following code..

<?php $comment= new Comment();
        $this->renderPartial('/comment/_form',array('model'=>$comment,)); 
?>

but now it is require that the data fill in the comment form of post view is store in the database. Another p开发者_如何转开发roblem, when fill data in the comment form of create new comment it creates 2 similar record in the databse.


Your problem is not very clearly explained, but form what I understand, you should try looking in to CFormModel and its validators.

Let me know if you would like to discuss details.

0

精彩评论

暂无评论...
验证码 换一张
取 消