Skip to content
Advertisement

how do I display cakephp query result in editable form [closed]

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; ?>

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement