Hi Tobias,

I had the same problem a while back.  Take a look at Matthews reply to
my post - http://www.nabble.com/Struggling-with-Zend-Form-td15399100s16154.html
- should help with your problem.

Thanks,
Alan

On 03/03/2008, Tobias Gies <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> Maybe you can help me with my problem. I have created my basic login
> form object like this:
>
> Pts/Form/User/Login.php:
>
> <?php
> /**
>  * Zend_Form
>  */
> require_once 'Zend/Form.php';
>
> class Pts_Form_User_Login extends Zend_Form {
>        public function __construct($options = array()) {
>                parent::__construct($options);
>                $this->addElement('text',
>                                  'username',
>                                  array('label' => 'Username:',
>                                        'required' => true,
>                                        'validators' => 
> array(array('NotEmpty', true),
>                                                              array('Regex', 
> false,
> '/^[a-z0-9_-]$/i'))))
>                     ->addElement('password',
>                                  'password',
>                                  array('label' => 'Password:',
>                                        'required' => true,
>                                        'validators' => array('NotEmpty')))
>                     ->addElement('submit',
>                                  'submit',
>                                  array('label' => 'Send'));
>        }
> }
>
> And I am calling it like this in my action controller (I'm currently
> only testing Zend_Form, so no processing code in there just yet):
>
> public function loginAction() {
>        require_once 'Pts/Form/User/Login.php';
>        $form = new Pts_Form_User_Login();
>        $view = $this->initView();
>        $view->form = $form->render();
> }
>
> The following error occurs:
> Catchable fatal error: Argument 1 passed to
> ReflectionClass::newInstanceArgs() must be an array, string given,
> called in 
> /var/www/premium-ts-redesign/application/library/Zend/Form/Element.php
> on line 972 and defined in
> /var/www/premium-ts-redesign/application/library/Zend/Form/Element.php
> on line 915
>
> I have xdebug running here, so I uploaded the full output of the code
> including the backtraces for you:
> http://stalker.akinos.de/xdebug-output.html
>
> Best regards and thanks in advance for your help,
> Tobias
>

Reply via email to