First post and all that, so a bit of an intro: I interviewed a guy the other day and he mentioned he used Yii. He said it was good, so I decided to give it a go for a little project we have. Must say, I am impressed. I’ve pulled together the bulk of the application in a weekend, and I budgeted a week for the app in Zend!
Question:
I have controller/view that displays “appointments”, but I need to create a pair that only shows appointments for ‘today’.
From poking about, it seems sensible to create a custom search method on the model, but I’m not sure how to essentially add a WHERE clause to the CActiveDataProvider. I need to make sure the “appointment_time” is today. It’s a mysql timestamp, so probably best with a between query.
If you aren’t using the ‘debug toolbar’ extension for development I highly recommend it. Turn on DB profiling and you will see query times and SQL used for the query. It is VERY useful for helping translate complex sql into active record objects because you can see what Yii is generating.