日付入力のあるこのフォームがあります。
echo $this->Form->create('Nodata');
echo $this->Form->input('date1', array('type' => 'date', 'label' => 'From:'));
echo $this->Form->input('date2', array('type' => 'date', 'label' => 'To:'));
echo $this->Form->end('Get Hours');
フォームが送信されると、フォームの下の同じビューに結果が表示されます。
私の問題は、フォームの一部ではないリンクがあり、フォームの日付フィールドから値を (ビューで) 読み取って、このリンクのパラメーターとして使用する必要があることです。
// date1 is the param I need to take the value from date input
<th> <?php echo $this->Html->link(__('Agents Detail'), array('controller' => 'qcas', 'action' => 'hours', 'paramProject' => $hour['Qca']['dir_id'], 'date1' => $this->data)); ?> </th>
このリンクはフォームの外側にあることに注意してください。フォームの入力を読み取り、リンクでパラメーターとして使用する方法が必要です。