Cgride View

first of all thank for the yii developer team you rock.

am new in yii and i was wondering where is the best place to code my query(i.e is it in controller or model)

i have tried using CDataProvider in controller with params passed for view inputs and its working collectively,but when i try the same with model:

  1. i don’t have an idea on how to pass params to be used in the criteria part

2.am confuse on how to merge the three Model,control and view together as in to have the logic in model that get param from view through controller

note:

what i need you people to help me with is an example of this scenerio:

  1. user enter data in two texfield in a form.

2.the data are passed to the controller using $_GET method i.e if(isset($_get(‘value1’)))

3 bind the value 1 into a param to be passed to a model

4 query the db based on the value one and display the result in a gride.

please help

am sorry for the bad english its not my first language

[color="#006400"]/* NOTE: moved to proper section (General Discussion for Yii 1.1.x instead of extensions) */[/color]

Hi, welcome to the Yii forum.

First of all, for the future, check a bit all the forum sections, read the descriptions below the section name to see what type of question you can post there… and then choose wisely where to post your question. For example you asked a "general question" in the extensions section that is specific for extensions questions and because your question was not proper maybe because of that you did not get any answer.

Also check the posting guidelines here - http://www.yiiframew…-in-this-forum/

Regarding your question… if you create a new Yii application and use Gii to create the complete CRUD for one of yours tables, you will get the code that does what you are asking in the question… so check that code and study it and if something is not clear, ask in this section for help.