Its not working. I need to create these condition using CDbCriteria and then use that criteria with cActiverecords. I have to avoid php code. Please help me.
See i have 5 fields for filter records. User can enter any one or can all 5 fields to be search. so i need to find how many fields has been entered by user to search and then create a search condition. But i must have to use CDbCriteria and CActiveDataProvider for filtering records.
i can create such condition in core php easily but facing problem in yii. i had tried 100 times but i am fail to get.
This search()will created in Model but how this will call in controller and how the records will be fetched. How this will call in CActiveRecords. Can you please write the code for me you will great help me.
I have a table tab1(tab1_id,mobilNo,name,stateId,cityId,campaignId,leadSourceId,leadStatusId,leadStageId).I need to fetch all the records on the user specific condition on mobilNo,name,leadSourceId,leadStatusId,and using join have to fetch city name,statename from citymaster,statemaster. user can enter any one or can all the 4 fields. then i have to detect the fields enter by user and makes the condition then fetch the records. But condition is that only by using CActiveDataProvider. Please help.
i need to remain show the value in text box after clicking on submit button. As we generally do in HTML text box like : <input type=“text” name=“name” value="<?php echo @$_POST[‘name’];?>">.
I want to do the same in yii. I tried to do this as :
You give me the link this will help full when we simply creating CHtml text field. But we are creating text field by model.
Actually the name field is an variable in my model, so when i post this by clicking submit button the fields get blank. But i need it to remain filed the entered value.