Yii Framework Forum: Problems with CForm - Yii Framework Forum

Jump to content

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

Problems with CForm Execptions not being catched Rate Topic: -----

#1 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 10 January 2010 - 08:21 PM

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.
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,892
  • Joined: 04-October 08
  • Location:DC, USA

Posted 10 January 2010 - 08:59 PM

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

#3 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 11 January 2010 - 12:51 PM

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

I dont know why I didnt try that before, thanks!
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
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