<?php if ($this->books): ?> <!-- 包含几本书信息的HTML表格. --> <table> <tr> <th>Author</th> <th>Title</th> </tr> <?php foreach ($this->books as $key => $val): ?> <tr> <td><?php echo $this->escape($val[‘author‘]) ?></td> <td><?php echo $this->escape($val[‘title‘]) ?></td> </tr> <?php endforeach; ?> </table> <?php else: ?> <p>There are no books to display.</p> <?php endif; ?>
时间: 2024-10-07 15:37:37