hi all:
i use cakephp 1.2.0.5427alpha
i want to do a simply select tags to the user in my register page
submit the day of birthday.
this selects tags are created by cakephp automatically when a use the
$form-input('model.field',array('type'='date'))
in the database the birthday field is DATE type
in the add view all perfectly works and all data store well in
database but when i render the edit view, when cake php fetch the date
of birthday to populate the birthday form field, i get this warnings.;
Warning (2): date() [function.date]: Windows does not support dates
prior to midnight (00:00:00), January 1, 1970 [CORE\cake\libs\view
\helpers\form.php, line 1087]
Warning (2): date() [function.date]: Windows does not support dates
prior to midnight (00:00:00), January 1, 1970 [CORE\cake\libs\view
\helpers\form.php, line 1030]
Warning (2): date() [function.date]: Windows does not support dates
prior to midnight (00:00:00), January 1, 1970 [CORE\cake\libs\view
\helpers\form.php, line 1061]
and the field of form dont populate with the database value.
this is my code an i relly dont know why doesnt work!! look simple but
i cant. somebody help me?
Other problem is that i cant do use the DMY date format.
?php echo $form-create('Usuario');?
fieldset
legendEdit Usuario/legend
?php
echo $form-input('id');
echo $form-input('nombre');
echo $form-input('apellidos');
echo $form-input('telefono');
echo $form-input('fax');
echo $form-input('email');
echo $form-input('password');
echo $form-input('password_confirm',array('type' =
'password','value'=$form-value('Usuario.password')));
echo
$form-input('genero',array('type'='select','style'='width:
125px;', 'selected'=$form-value('Usuario.genero'), 'options'=
array( 0 =__('Mujer', true),1=__('Hombre', true;
echo $form-input('fecha_nac', array('type' = 'date',
'label' = '', 'empty' = false, 'minYear' = date('Y')-100,
'maxYear' = date('Y'), 'dateFormat' = 'MDY')); // this is the
problem
echo $form-input('pais_id');
echo $form-input('ciudad');
echo $form-input('provincia');
echo $form-input('created',array('type' = 'hidden'));
//echo $form-input('modified',array('type' = 'hidden'));
?
/fieldset
?php echo $form-end('Submit');?
//controller
function edit($id = null) {
if(!$id empty($this-data)) {
$this-Session-setFlash('Invalid Usuario');
$this-redirect(array('action'='index'), null, true);
}
if(!empty($this-data)) {
$this-cleanUpFields();
if($this-Usuario-save($this-data)) {
$this-Session-setFlash('The Usuario saved');
$this-redirect(array('action'='index'), null,
true);
} else {
$this-Session-setFlash('The Usuario could not
be saved. Please,
try again.');
}
}
if(empty($this-data)) {
$this-data = $this-Usuario-read(null, $id);
}
$paises = $this-Usuario-Pais-generateList();
$this-set(compact('paises'));
}
i'll thanks any help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---