I have trouble saving my date field into database using CakePHP.
Table column name
[User].[dob]
View
<?php echo $this->Form->input('dob', array('type'=> 'date', 'label' => FALSE, 'dateFormat' => 'DMY', 'minYear' => date('Y') - 111, 'maxYear' => date('Y'))); ?>
I get the following error when I submit the form -
2011-12-29 00:33:57 Debug: Notice (8): Array to string conversion in [C:\xampp\htdocs\dearmemoir\cake\libs\router.php, line 1573]
This field is part of the Auth User Model. Any ideas what might be going wrong?
var_dump(...);to see what you're really returning there.date('Y') - 111is a string - an int, maybe tryintval(date('Y')) - 111? No, my bad, it works!<?php var_dump( $this->Form->input('dob', array('type'=> 'date', 'label' => FALSE, 'dateFormat' => 'DMY', 'minYear' => date('Y') - 111, 'maxYear' => date('Y'))) ); ?>. Is this the method: api.cakephp.org/class/form-helper#method-FormHelperinput