-- Panman <[EMAIL PROTECTED]> wrote
(on Thursday, 03 July 2008, 09:31 AM -0700):
> I am new to ZF and due to my current situation, cannot use the MVC way of
> things. So, I'm starting to play around with Zend_Form but cannot figure out
> how to render the form without Zend_View. What is the best way to use
> Zend_Form in a non-MVC setup? Thanks!

You have two options. First, Zend_Form by default uses Zend_View helpers
to render output. However, usage of Zend_View does not imply that you
are using the MVC.  Put those two facts together, and you can use
Zend_Form as is just by passing the form a view object:

    $form->setView(new Zend_View);

Just do that anytime before echoing the form, and you'll be fine. (This
is in fact how I tested Zend_Form.)

As for your second option, if you want to use Zend_Form without a view
object for some masochistic reason, you can, but you'll need to develop
your own decorators. For that, you should read the tutorial I did on
decorators:
    
    http://devzone.zend.com/article/3450-Decorators-with-Zend_Form

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to