-- Superbiji » <[EMAIL PROTECTED]> wrote
(on Wednesday, 03 December 2008, 06:31 PM +0700):
> i've tried to create zend dojo form in Action and it's work nicely
> (using ZF 1.7.1), for example:
>
> function dojoformAction() {
> Zend_Dojo::enableView($this->view);
>
> $form = new Zend_Dojo_Form();
> $form->setMethod("post");
> $form->setAction("save")
> ->setName("myform");
>
> $form->addElement('TextBox', "location",
> array("label"=>"Location",
> 'propercase' => 1
> ));
>$form->addElement('SubmitButton',
> 'submit',array('label'=>'Submit'));
> $this->view->form = $form;
> }
> and echoing in view script;
>
> But.. how to create zend dojo form in View script? I want "free form"
> placement of elements.. and i can't see $view->form->captureStart()
> method
Use the ViewScript decorator with your form. With that decorator, you
specify a view script for your form -- and then in your action's view
script, you still just do:
form ?>
The difference is that this will render the view script associated with
the decorator -- and from there, you can do things like you have below.
> for example, in view:
> form()->start() ?>
> textbox("text1", "value", array()) ?>
> textbox("text2", "value", array()) ?>
> submitbutton("submit") ?> $this->submitbutton("cancel") ?>
> $this->form()->end();
> $this->form()->prefillDefaultValues( $this->rows );
> ?>
>
> Is this possible..? thanks
>
>
> --
> Kamus Online - http://kamus.landak.com/
>
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/