What is the correct (recommended method) for passing information to a view in a MVC environment.
Currently we use Zend Framework, where we write classes to handle specific things EG
a Book class with a save and load method to retrieve info from the DB, which is called from a particular nameAction().
What I would like to know is what is the best way to pass this information to the view, in some cases we do $this->view->book_name = $book->getBookName();
and in other cases we do the following
$this->view->book = $book; OR $this->view->books = Book_Manager::getAllBooks(); and then access the object(s) properties in the view.
Information on-line suggests we try limit what access a view has to information, i.e pass them only what they need and in some cases people say its ok to pass stuff through as long as nothing is done to that information.
Regards