Typically you will assign some bit of data to the view object inside a controller action using something like:
$form = My_Form;
//assign My_Form to the view object
$this->view->form = $form;
in your view script you would normally access that data using something like:
//this bit of code would display your whole form in the view script
//along with any layout information contained in your layout file
<?php echo $this->form ?>
also items can be assigned to the view object from the bootstrap and these items will be available to the layout or view scripts. Here is an example:
protected function _initView() {
//Initialize view
$view = new Zend_View();
//get doctype from application.ini
$view->doctype(Zend_Registry::get('config')->resources->view->doctype);
$view->headTitle('Our Home');
//get content-type from application.ini
$view->headMeta()->appendHttpEquiv('Content-Type',
Zend_Registry::get('config')->resources->view->contentType);
//add css files
$view->headLink()->setStylesheet('/css/blueprint/screen.css');
$view->headLink()->appendStylesheet('/css/blueprint/print.css', 'print');
$view->headLink()->appendStylesheet('/css/master.css');
$view->headLink()->appendStylesheet('/css/main.css');
$view->headLink()->appendStylesheet('/css/nav.css');
//add it to the view renderer
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
'ViewRenderer');
$viewRenderer->setView($view);
//Return it, so that it can be stored by the bootstrap
return $view;
now this data is access inside of a layout.phtml in this manner:
<?php echo $this->doctype() . "\n"; ?>
<html>
<head>
<?php echo $this->headMeta() . "\n" ?>
<?php echo $this->headLink() . "\n" ?>
<!--[if lt IE 8]>
<link rel="stylesheet" href="/css/blueprint/ie.css" type="text/css" media="screen, projection" />
<![endif] -->
</head>
now for completeness here is the PHP manual version of $this:
Within class methods the properties, constants, and methods may be
accessed by using the form $this->property (where property is the name
of the property) unless the access is to a static property within the
context of a static class method, in which case it is accessed using
the form self::$property. See Static Keyword for more information.
The pseudo-variable $this is available inside any class method when
that method is called from within an object context. $this is a
reference to the calling object (usually the object to which the
method belongs, but possibly another object, if the method is called
statically from the context of a secondary object).
This is not a complete explaination but I hope it get's you started.