Why the default Yii testdrive doesn’t uses $model as a property of the controller ?
instead of passing $model to render() then to renderPartial()…
class myController extends Controller {
public $model;
public function actionIndex() {
$this->model=foo::model()->findAll();
$this->render('index');
}
}
In my opinion… because Yii tries to be as elastic and open as possible. What about applications, when you don’t use models at all (look at the simpliest “Hanging man” demo application). Why to send empty model in such situation.
Which of course doesn’t limit you to do exactly as you wrote - declare own property in controller and use it in a view.