信息详细页面

创建控制器文件:controller/notes/show.php 对应详细信息展示的控制器。

show.php内容如下:

<?php
$note = new Model('notes');
$note->find(get(1));
?>

创建视图文件:view/default/notes/show.html 对应详细信息展示的视图。

show.html 内容如下:

<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>CRUD测试-详细信息</title>
<style type="text/css">
</style>
</head>
<body>
<form action="" method="post">
{$note->lable('title')}:{$note->title}<br/>
{$note->lable('author')}:{$note->author}<br/>
{$note->lable('theme')}:{$note->field_text('theme')}<br/>
{$note->lable('postdate')}:{date('Y-m-d',$note->postdate)}<br/>
{$note->lable('bepublished')}:{$note->field_text('bepublished')}<br/>
{$note->lable('content')}:<br/>
{$note->content}<br/>
</form>
</body>
</html>

浏览器输入:http://www.yyuc.net/notes/show-1.html