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, and as a result I'm getting a 'Notice' thrown.  Why
should I receive a notice while the Quickstart version does not?  The
two bits of code are very very similar.

Notice: Array to string conversion in
/home1/ioforgec/zendev/library/Zend/View/Helper/FormElement.php on
line 55

Here is the way I've instantiated the form:

     $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;

As you can see I've tried both instantiating Zend_Form with the fully
typed out parameters, and I've tried it by passing an array, either
way the notice is thrown.  I realize this is only a notice, however i
don't understand what I'm doing differently than the code in the
Quickstart which just to remind looks like this:

        $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'
                ))
            ),
        ));

        return $form;

Thanks in advance ...

Reply via email to