簡體   English   中英

我如何從查詢轉換 cakephp 文本 output 以便它顯示在輸入表單中進行編輯

[英]how do i convert cakephp text output from a query so that it is displayed in an input form for edit

I have the below code as text output from a cakephp orm query, how do make a cakephp text output from a query so that it is displayed in an input form for edit, please with reference to the code below how can i amended so that it是輸入形式並且是可編輯的。

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

使用以下代碼解決了問題

<table>
<tr>                                    
<?php foreach ($examination as $key => $exam): ?>
<td><?php echo ($exam['ExamCalendar']['reg_exam_date'] !=0) ? $this->Form->input('Result Verification Status',['value'=>$exam['ExamResult']['verification_status']]) :'<b>Not Verified</b>'?></td>
 <?php endforeach; ?>
</tr>
</table>

這將顯示和輸入框,其中包含來自查詢的值

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM