2

我对 ZF 很陌生,我必须遵循公司文件结构并在其上设置 Zend Navigation。

我有一个这样的包含脚本:

<?php
//test1.php
$config = new Zend_Config_Xml( $_SERVER{'DOCUMENT_ROOT'}.$sitePath.'lib/navigation.xml', 'nav');
$container = new Zend_Navigation($config);
$view = new Zend_View();
$view->navigation($container);
$view->addScriptPath($_SERVER{'DOCUMENT_ROOT'}.$sitePath);
echo $view->render('test1.php');
?>

<!--And in my View Script:-->
<html>
<head>
</head>
<body>
    <div id="menu">
        <?php echo $this->navigation()->menu(); ?>
    </div>
    <div id="breadcrumbs">
        You are in: <?php echo $this->navigation()->breadcrumbs()->setLinkLast(false)->setMinDepth(0)->render(); ?>
    </div>
    <div id="content">
        Content of your page here.
    </div>
</body>

但是我有这个错误:

致命错误:调用 C:\Zend\ZendServer\share\ZendFramework\1.10\library\Zend\Navigation\Page\Mvc.php 中非对象的成员函数 getParams() 第 133 行

谁能指出我哪里出错了?很多示例都使用引导程序和 MVC,但在我的项目中,我必须坚持使用旧的文件结构(非 MVC),我现在正在苦苦挣扎。

我正在研究这些例子:

http://framework.zend.com/manual/en/zend.navigation.containers.html

4

0 回答 0