嵌入式框架iframe在Zend Framework中的应用

本文展示了一个使用PHP框架加载不同页面的示例。通过在index.phtml中定义的结构,可以根据点击左侧导航栏的不同链接,在同一框架内加载并显示不同的内容页面。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我的index.phtml文件代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>


<body>
<table width="729" height="449" border="0">
  <tr>
    <th height="66" colspan="2" scope="col">TOP</th>
  </tr>
  <tr>
    <td width="107" height="375" valign="top"><p><a href="<?php echo $this->baseUrl;?>/<?php echo $this->right?>" target="in">right1</a></p>
    <p><a href="<?php echo $this->baseUrl;?>/<?php echo $this->right2?>" target="in">right2</a></p>
    <p><a href="<?php echo $this->baseUrl;?>/<?php echo $this->right3?>" target="in">right3</a></p></td>
    <td width="606" height="375" valign="top"><iframe src="<?php echo $this->baseUrl;?>/<?php echo $this->right?>" width="100%" height="100%" name="in" frameborder="0" scrolling="no"></iframe>&nbsp;</td>
  </tr>
</table>
</body>

</html>

让我们看看public function indexAction()是什么样子

 public function  indexAction()
    {
    $this->view->right='user/guestbook/show';
    $this->view->right2='user/guestbook/modify';
    $this->view->right3='user/guestbook/sign';
    $this->view->title='浏览内容';
   }

效果图:

点击左右的链接,右边就会出现对应的页面。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值