Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Get One Record From Cactiverecord's Array

$
0
0
Hi there.
I'm new in Yii, doing my first project (some kind of personal calendar, or organizer).
The solution I use is apparently not optimal, if you know how to do it better, please write me about it.

Situation:
I need to change the value of some CActiveRecord model with particular field I don't know until user choose it in view.
How can I filter (select from) CActiveRecord's array that I pass to the view from my controller without using all the variety of find...() methods?
I think they will query database, but it's unnecessary for me, because I already pass all needed information to the view.
I use CActiveRecord instead of DataProvider in order to save changes, which user will do.
Here are the fields of model I need to change (change only field Name).
 * The followings are the available columns in table 'tbl_category':
 * @property string $ID
 * @property string $OwnerID
 * @property string $Name

So for example, user checks the name of Category from DropDownList he wants to change and then he writes a new name for this Category, push the button and saves new name of Category in database.

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>