Hi!,

I'm trying to do the following "simple form" with Zend_Form without MVC, but
I have the problem:

Warning: ViewHelper decorator cannot render without a registered view object
in /usr/local/lib/ZendFramework-1.8.0/library/Zend/Form/Element.php on line
1929

I don't understand relationship between Zend_Form and Zend_View without MVC.
Anyone could I help me?

Thanks!

tip ..

// My script 
require_once('Zend/Form.php');
require_once('Zend/View.php');

$form = new Zend_Form();
$view = new Zend_View();

$form->setAction('form.php')
     ->setMethod('post')
     ->setAttrib('id','myForm')

$name = $form->createElement('text','myName')
                       ->setLabel('Name');

$lastName = $form->createElement('text','apellido')
                            ->setLabel('Last Name');

$submit = $form->createElement('submit','submit');

$form->addElement($name);
$form->addElement($lastName);
$form->addElement($submit);


   // I put this sentence, "$_SERVER" because this script doesn't work  
   // with Controllers.
   //
   if ($_SERVER['REQUEST_METHOD'] == 'GET')
   {
       print $form->render($view);
       exit();
   }

   $form->setView($view);

   if (!$form->isValid($_POST))
   {
        print $form;
        print_r ($form->getErrors());
   }

   else {

        print $form->nombre;   <-- Here! the problem ..

        // print_r($form->getValues()); 
        // print_r($form->getUnfilteredValues());
   }


----------------------

-- 
View this message in context: 
http://www.nabble.com/Simple-Zend_Form-without-MVC-..-tp24486486p24486486.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to