Yii Framework Forum: CForm: Zugriff auf Formularelemente nicht möglich - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CForm: Zugriff auf Formularelemente nicht möglich Rate Topic: -----

#1 User is offline   YuriOrlov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 06-July 12

Posted 06 July 2012 - 06:14 AM

Hallo,

ich versuche auf CForm-Formularelemente zuzugreifen.
Dies wird mit Fatal error: Call to a member function error() on a non-object in
framework/web/form/CFormInputElement.php on line 232 quittiert.
Warum ist das so?


// Controller:
public function actionIndex()
{
     
   $model = new tbl1;               
   
   $form = new CForm('application.views.site.registerForm',$model);

   if($form->submitted('register') AND $form->validate())
   {

        // Fatal error: Call to a member function error() on a non-object in       
        //framework/web/form/CFormInputElement.php on line 232
        echo $form->elements['username'];

   }

}

<?php
// registerForm.php
return array(
    'elements'=>array(
               'username'=>array(
                    'type'=>'text',
                ),
                'password'=>array(
                    'type'=>'password',
                ),
                '<hr>',
                
                'name'=>array(
                    'type'=>'text',
                ),
                'vorname'=>array(
                    'type'=>'text',
                )
            ),
        
    'buttons'=>array(
        'register'=>array(
            'type'=>'submit',
            'label'=>'Registrieren',
        ),
    ),
);

0

#2 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 488
  • Joined: 08-October 12
  • Location:Austria

Posted 10 February 2014 - 08:27 AM

Hallo,
Hast du schon diese problem gelöscht ?

Viele gruß,
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users