Link to home
Start Free TrialLog in
Avatar of Peiris
PeirisFlag for United States of America

asked on

Zend Framework objects vs arrays

Hi

I am working on a project that is written in Zend Framework. In that, the entire objects being given to views. For example


$Object = new ClassName();

$this->view->data = $Object;

Open in new window

                       



then within the view, it pull the necessary info from the object.

My question is, is this is a good practice in general ? I think passing only necessary info using array or individual variables to views is more efficient than completely duplicating the object in the memory. But, I might be wrong, because processing to get the info what we need only within the view might be expensive. I just want to know what is the best practice for this.

Any suggestions and reading materials (links) will be greatly appreciate it.

Thanks
Peiris
ASKER CERTIFIED SOLUTION
Avatar of Member_2_248744
Member_2_248744
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Peiris

ASKER

This solved my problem