|
|||
|
I have some misunderstanding how can I get rid of any business logic in my view files. For example in controller i get list of products and in View I iterate through them with foreach:
PHP Code:
PHP Code:
Maybe there is some better solution to this problem? Last edited by SpotSec : 05-04-2007 at 09:46 PM. |
|
||||
|
You can't try to get into controller all results in one query ?
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
|||
|
It's a common problem. You could do two things, one is to create a helper function in the model. Use custom row classes for this. So you can call getSpecs() on a row of the Product class. You're using the model itself for it, so you will need more code in your views.
I have written a blog post that deals with something similar: Naneau » Extra fields for Zend_Db_Table check it out! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|