View Single Post
  #2 (permalink)  
Old 04-13-2008, 07:02 PM
c0mrade c0mrade is offline
Junior Member
 
Join Date: Mar 2008
Posts: 6
Default

Solved it myself! After messing around with the code I came up with this - which works.

Code:
<?php

// Setup Include Paths
define('ROOT_DIR', dirname(__FILE__));
set_include_path(
	  ROOT_DIR . '/library' . PATH_SEPARATOR
	. ini_get('include_path') . PATH_SEPARATOR
);

// Load Classes On Demand
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoLoad();

// Setup View
$view = new Zend_View();
$view->setScriptPath('views');

// Setup Config
$config = new Zend_Config_Ini(ROOT_DIR . '/config/config.ini');

// Setup Form
$form = new Zend_Form($config->form1);

// Output Form
$view->form = $form->render($view);
echo $view->render('view.php');
The last two lines were the difficult part. You must use the Zend_Form::render() method, passing it your view object, then render the actual view.

You're welcome

Last edited by c0mrade : 04-13-2008 at 08:55 PM.
Reply With Quote