View Single Post
  #1 (permalink)  
Old 06-24-2008, 05:18 AM
Matt1776's Avatar
Matt1776 Matt1776 is offline
Junior Member
 
Join Date: Jun 2008
Location: Orange County, California
Posts: 15
Send a message via Yahoo to Matt1776 Send a message via Skype™ to Matt1776
Default Strange error with Zend_Form

I did not see a proper place to post about zend_form so I will do so here.

I've taken a queue from the zend framework site's quickstart and created a form for a simple login. However I did so in a slightly different way, I dont see how my way could have caused an error.

The error is more a notice (as it states) but why should I receive a notice while the quickstart version does not?

Notice:

Code:
Notice: Array to string conversion in /home1/ioforgec/zendev/library/Zend/View/Helper/FormElement.php on line 55
Code:
      $submit = array('submit', array('label' => 'Log In'));

      $struct = array('uname' => array('text', array('required' => true, 'label' => 'Username')),
                      'pword' => array('password', array('required' => true, 'label' => 'Password')));

      $config = array('method' => 'post', 'elements' => $struct, 'submit' => $submit, 'action' => '/index/login');

      $form = new Zend_Form(array('method' => 'post', 'elements' => $struct, 'submit' => $submit, 'action' => '/index/login'));
      //$form = new Zend_Form($config);

      return $form;
This is the one from the quick start, I dont see how this one is much different:

Code:
        $form = new Zend_Form(array(
            'method'   => 'post',
            'elements' => array(
                'comments' => array('textarea', array(
                    'required' => true,
                    'label' => 'Write your comments'
                )),
                'submit' => array('submit', array(
                    'label' => 'Add Comment'
                ))
            ),
        ));
__________________
Bugs that go away by themselves come back by themselves
Never take life seriously, Nobody gets out alive anyway.
Reply With Quote