Yii Framework Forum: webapp admin view - search - MVC question - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

webapp admin view - search - MVC question Rate Topic: -----

#1 User is offline   thomas.mery 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 107
  • Joined: 04-January 09

Posted 12 April 2010 - 04:17 AM

Hi,

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 !
0

#2 User is offline   lgoss007 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 88
  • Joined: 01-October 09

Posted 12 April 2010 - 10:00 AM

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?
0

#3 User is offline   thomas.mery 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 107
  • Joined: 04-January 09

Posted 12 April 2010 - 10:12 AM

thanks

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users