webapp admin view - search - MVC question


I was wondering if there was a reason why the search on a model is performed from the admin view in the generated webapps.

I was looking for this code in the admin action in the controller as I thought controller actions was where application logic should go.

thanks if someone can clarify this for me and also tell me if there would be side effects if I for instance replaced the $model->search in the view by a view variable declared in the controller.

Thanks !

Well technically the search on the model application logic is in the model, yes the execution is in the view but no logic.

There might be side effects with the ajax (don’t remember what it calls), otherwise it should work. But why pass more data to the view than you need?


I am used to pass variables to the view rather than calling model methods in it. But I guess it’s just matter of taste and also I tend to look for how data is obtained in the controller action.

no big deal I guess