布局.phtml:
<?php echo $this->doctype() ?>
<html>
<head>
<?php echo $this->headTitle()."\n"; ?>
<?php echo $this->headLink() ."\n"; ?>
<?php echo $this->headScript(); ?>
</head>
<body>
<div id="wrap">
<div class="header">
<div class="logo"><a href="index.html"><img src="../../images/logo.gif" alt="" title="" border="0" /></a></div>
<div id="menu">
<ul>
<li class="selected"><a href="index.html">home</a></li>
<li><a href="about.phtml">about us</a></li>
<li><a href="category.phtml">books</a></li>
<li><a href="specials.phtml">specials books</a></li>
<li><a href="myaccount.phtml">my accout</a></li>
<li><a href="register.phtml">register</a></li>
<li><a href="details.phtml">prices</a></li>
<li><a href="contact.phtml">contact</a></li>
<li><a href="addbook.phtml">adddbook</a> </li>
</ul>
</div>
</div>
<div class="center_content">
<div class="left_content">
<?php echo $this->layout()->content ?>
我是 zend 框架的新手,在这里我遇到了显示导航的问题。在纯 php 中,我可以通过检查会话来提供导航服务。像这样:
<?php
if($_SESSION['usertype']=='admin')
{
echo "<li><a href="addbook.phtml">adddbook</a> </li>";
}
?>
我的问题是如何在 zend 框架中实现它。谢谢