phpcakephpcakephp-1.3

how do I display cakephp query result in editable form


how do I display cakephp query result in editable form such that it is displayed in an input form for edit. The code below displays query result in a table

<?php foreach ($examination as $key => $exam): ?>
<td><?php echo !empty($exam['ExamCalendar']['reg_exam_date']) ? date('d-m-Y', strtotime($exam['ExamCalendar']['reg_exam_date'])) : '--'; ?></td>
<?php endforeach; ?>

Solution

  • resolved the issue using the below code

    <table>
    <tr>                                    
    <?php foreach ($examination as $key => $exam): ?>
    <td>
    <?php echo !empty($exam['ExamCalendar']['reg_exam_date']) ? $this->Form->input('Result Verification Status',['value'=>date('d-m-Y', strtotime($exam['ExamCalendar']['reg_exam_date']))]) : '--'; ?>
    </td>
     <?php endforeach; ?>
    </tr>
    </table>
    

    This displays and input box with value from the query