Yii form submition problem

I am new to Yii framework, i would like to use Yii for my work. And i have setup all the steps as described in the tutorials. And i am feeling difficult to get the next page while submit the form, also if i created the pages through auto-generate code the things are working properly, but if i did some customization i am getting error on the resultant page.

Can someone please help me to solve this issue, and please correct me if i am going in the wrong direction…

Can you give more details? Your models, code snippets, what customization you are doing?

Thank you Mukesh for your fast reply. Somehow i have figure out the issue, it was a mistake in my code.

Now i am struggling with another issue. My home page contains different modules like a forum, some product listing with details, next section with product reviews and finally a chat window. I was trying to show a rough structure of the page as an image but i am not able upload an image from local machine.

In simple on same page i have to list or load data from multiple DB tables, how can i do that, now i am struggling with these task.

Can you please help me on this issue?

Let’s assume there are three types of information on your home page -

  1. forum

  2. product listing

  3. product review

you can create three different model classes for the three types of information. Use Gii (search for it) to create the models

in the action method for your home page, you can then create an instance of each of the three models -

var $forumModel = new Forum;

var $productModel = new Product;

var $reviewModel = new Review;

use the model instances to query for whatever information you need.

make three partial views to show the three components. And in the view file for the controller, call the three sub views with

renderPartial method.

I can help you more if you can send me your code sample.

Thank you Mukesh.

I have used the partial view in the index page as well as the view page:

in post/index.php

	$model=new Post;

	echo $this->renderPartial('_form', array('model'=>$model));

        $this->widget('zii.widgets.CListView', array(




in post/view.php

	.....  some codes here  .........

        $comment = new Comment;

	echo $this->renderPartial('/comment/_form', array('model'=>$comment)); 

	.....  some codes here  .........

Now i am still in problem. I will explain my requirement here:-

I have to display multiple details on the same page and from there i want to save, ie, post different forms from the same page itself. Here i reused the blog example. My requirement is similar like a facebook listing. Which means, the user can have the ability to post new topics, in the top and reviewing users to comment on the post. all these should be on the same page. I have somehow listed everything on the index page but i cannot insert anything into database from the same page, but actually the form will post while clicking on the submit button, but the data won’t insert into table.

At the same thing if we try to add the post from its own page (ie, now i have tried to post from index page which won’t work, no error, suppose if i am trying to add a new post from /post/create then it will work), then the data will store into database.

So to get an exact picture, we can compare it with facebook home page, there in the middle column top we have an option to share something ( in our case we need to post new topic) and also there are different comments for the shared topic from our friends (the same way we have some comments for our post from our friends). In facebook all these happening on the same page, similar way we need to create post and comments from the same page.

Can anyone please help me to come out from this situation.