PHP Zend framework 配置与调试(二)

来源:互联网 发布:数据有效性检验 编辑:程序博客网 时间:2024/06/07 03:25

一、Scripts中index.html内容:

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>显示数据</title>
</head>
<body>
<a href="<?php echo $this->baseUrl ?>/index/add/">增加数据</a>

<table width="800px" border="1">
<thead>
<tr><th class="title" colspan="2">数据显示列表</th></tr>
<tr><td>标题(title)</td><td>内容(content)</td></tr>
</thead>
<tbody>
<?php foreach($this->messages as $message):?>
<tr>
<th><?php   echo $message['title']; ?></th>
<td><?php echo $message['content']; ?></td>
<td width="100px"><a href="<?php echo $this->baseUrl ?>/index/edit/id/<?php echo $message['id']; ?>/">编辑数据</a></td>
<td width="100px"><a href="<?php echo $this->baseUrl ?>/index/del/id/<?php echo $message['id']; ?>/">删除数据</a></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</body>
</html>

 

 

 

二、add.html内容:

 

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>增加数据</title>
</head>
<body>
<form method="post" action="<?php echo $this->baseUrl?>/index/add/">
<b>增加数据</b><br>
标题:<input type="text" name="title" value="" size="20"><br/>
内容:<textarea  name="content" id="content" col="40"></textarea><br/>
<input type="submit" value="增加数据"/>


</form>
</body>
</html>

 

 

三、edit.html内容:

 

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改数据</title>
</head>
<body>
<a href="<?php echo $this->baseUrl ?>/index/add/">增加数据</a><br/>
<a href="<?php echo $this->baseUrl ?>/index/index/">显示数据</a><br/>
<hr>

<form method="post" action="<?php echo $this->baseUrl?>/index/edit/">
<?php foreach($this->messages as $message):?>

标题:<input type="text" name="title" value="<?php echo $message['title']; ?>" size="20"><br/><br/>
内容:<textarea  name="content" id="content"   col="40"><?php echo $message['content'] ?></textarea><br/>
<input type="hidden" name="id" value="<?php echo $message['id']; ?>" /><br/>
<input type="submit" value="修改数据"/>
<?php endforeach; ?>

</form>

 


</body>
</html>

 

 

四、del.html内容:

 

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>删除数据</title>
</head>
<body>
<a href="<?php echo $this->baseUrl ?>/index/add/">增加数据</a><br/>
<a href="<?php echo $this->baseUrl ?>/index/index/">显示数据</a><br/>
<hr>

<form method="post" action="<?php echo $this->baseUrl?>/index/edit/">
<?php foreach($this->messages as $message):?>

<b>标题:</b><?php echo $message['title']; ?><br/>
<b>内容:</b><?php echo $message['content'] ?><br/>
<input type="hidden" name="id" value="<?php echo $message['id']; ?>" /><br/>
<input type="submit" value="确认删除数据"/>
<?php endforeach; ?>

</form>

 


</body>
</html>

 

 

原创粉丝点击