I’m still wondering if I should query my model directly from the view, for example with
<?php echo User::model()->active()->count(); ?>
or if I should have my controller do it and then just pass the variable from the controller into my view.
I know that Yii queries the model directly at least when working with forms.
But does that work when I at some point decide to use unit tests?
How are you all handling this?