Re: Add to result array in controller

2009-04-04 Thread rossjha
I'm using improvement['status'] e.g. Pending, Declined, Approved to display on screen for the user. I use the same value for the for a css class class="pending" On Apr 2, 4:11 pm, Jimmy Bourassa wrote: > Of course, it works. But that's not very MVC like in my opinion, the > color of the statu

Re: Add to result array in controller

2009-04-02 Thread Jimmy Bourassa
Of course, it works. But that's not very MVC like in my opinion, the color of the status only has to do with the way you'll view things, it is in no way related to your data manipulations. You're also loading extra stuff in memory by adding that css class value for every item of your find - not t

Re: Add to result array in controller

2009-04-02 Thread rossjha
Got what i'm looking for, afterFind function which is run via the model. function afterFind($results){ foreach($results as $key => $val){ if(array_key_exists('Improvement', $val)){ $res

Re: Add to result array in controller

2009-04-01 Thread rossjha
Thanks for getting back to me, just getting to grips witth MVC, so i wasn't sure adding logic in the view would be the best thing. Thanks a lot Ross PS i will be using css classes, just a quickie function for demo On Apr 1, 6:36 pm, Jimmy Bourassa wrote: > Your color really should be a CSS cl

Re: Add to result array in controller

2009-04-01 Thread Jimmy Bourassa
Your color really should be a CSS class. Since you only need the color in your views, I'd put that bit of logic in a view, where it truly belongs. You could just extend your app view with your getStatusColour function and call this function in whatever kind of loop you'll use in your views. I ho

Add to result array in controller

2009-04-01 Thread ross.hagg...@googlemail.com
Hi I have a number of posts which can be one of 3 states, pending, approved, declined. I want to add some colour to my view when displaying all the posts and i'm not sure how to do it. I have an $improvement array and a getStatusColor function in the app_controller. How can i read each item in

Add to result array in controller

2009-04-01 Thread ross.hagg...@googlemail.com
Hi I have a number of posts which can be one of 3 states, pending, approved, declined. I want to add some colour to my view when displaying all the posts and i'm not sure how to do it. I have an $improvement array and a getStatusColor function in the app_controller. How can i read each item in