Problems with CForm

Hi all,

Im having problems with CForm as everytime there is an error I get this:


Fatal error: Method CForm::__toString() must not throw an exception in C:\path\to\my\view.php on line 0

Which is giving me a really hard time finding the error.

I trying to use a widget in my form configuration here is the code.


<?php

return array(

	'title'=>'User information',

    'elements'=>array(

		'firstname'=>array(

             'type'=>'text',

			 'class' => "span-7",

         ),

		'lastname'=>array(

			'type'=>'text',

         	'class' => "span-7",

        ),

		'username'=>array(

        	'type'=>'text',

        	'class' => "span-7",

		),

        'password'=>array(

        	'type'=>'password',

			'class' => "span-7",

        ),

        'email'=>array(

        	'type'=>'text',

        	'class' => "span-7",

        ),

        'birthDate'=>array(

    	    'type'=>'zii.widgets.jui.CJuiDatePicker',

        	'name'=>'birthDate',

        	'class' => "span-7",

        ),

	),

    'buttons'=>array(

        'register'=>array(

            'type'=>'submit',

            'label'=>Yii::t('main', 'RegĂ­strate'),

			'class' => 'ok'

        ),

    ),

);

?>

Can someone please help me find whats wrong in it ? thanks.

How about calling $form->render() instead of echo $form in your view?

Its working now thanks (working meaning I can see the CExecption now)

I dont know why I didnt try that before, thanks!