この方法を使用して CakePHP で誕生日を設定していますが、ページに戻ると常に現在の日付が取得されるため、ページに触れずに保存すると、今日の日付が誕生日として取得されます。
<?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);
?>
以前に保存したデータをデータベースからフォームに設定するにはどうすればよいですか?