Hi, well i’m very new to oop, mvc, and Yii framework, and i’m no developer at full time…i just do it for fun.
Since i’m trying Yii and MVC for the first time…and i’m facing a problem that i think can be easily done with the right knowledge, i tought to ask here, cos i can’t find a solution anywhere :\
i’ve my webapp running with two tables tbl_videos and tbl_comments.
i’ve added some videos, and manualy some video comments to my tables.
And now i can view my videos (videos/view&id=1) where ‘id’ it’s the ‘id’ of the video under tbl_videos.
On that same video view i have a nice and working CListView widget with a great ajaxed pagination with this code below
...
<h1>Video Comments</h1>
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider' => new CActiveDataProvider('VideosComentarios', array(
'criteria' => array(
'condition' => 'video_id=:vId AND activo=:act',
'order' => 'id DESC',
'params' => array(
':vId' => $model->id,
':act' => true,
)
),
'pagination' => array(
'pageSize' => 2,
),
)
'itemView' => '/videos/_view_comentarios',
'ajaxUpdate' => true,
//'ajaxVar' => 'ajax1',
'id' => 'comentariosVideo',
));
?>
that shows me the video that i’ve requested plus the corresponded comments for that same video.
And now what i want is to create a way in this same controller/view (videos/view.html) above this create a CForm/CActiveForm to insert new coments direcly into tbl_comments.
but i’m a little lost on how to implement that. can anyone show me some light on it.
in short: i want to be in the videos controller, ‘view’ show the flash video player, showing the form to insert into tbl_comments a new comment, and bellow the already inserted comments.
BUT i don’t want create a model and CRUD implmentation with gii in a way that users can see that 'insert comments form’if they directly go to ‘commentsController/create’ .
do i make myself clear?
and sorry for my bad english, it ain’t my native language.
thanks in advance