I'm using this way to set the birthday in CakePHP, but when i turn back in the page I always get the current day date, so if I save the page without touch it, i get the today date as birthday:
<?php
$attributes = array (
'minYear' => date('Y') - 100,
'maxYear' => date('Y') - 0,
'label'=> false,
'default' => $user['Profile']['birthday'],
'value'=>$user['Profile']['birthday'] // how to set the previous saved data?
);
$options = array (
'id' => 'birthday',
'after' => '<div class="message">Inserisce la tua data di nascita</div>'
);
echo $this->Form->input('Profile.birthday', $attributes, $options);
?>
How can i set the previous saved data from the database to the form?