English 中文(简体)
Zend_Navigation not toload
原标题:Zend_Navigation failing to load

此前的

我现在收到以下错误信息:

<b>Fatal error</b>:  Uncaught exception  Zend_Navigation_Exception  with message  Invalid argument: Unable to determine class to instantiate  in C:wwwmysitedevelopmentwebsitelibraryendNavigationPage.php:223

I ve试图使我的导航、Xml档案与Zend Documentation 。 然而,我似乎无法工作。 我的XML文件就是这样:

<?xml version="1.0" encoding="UTF-8"?>
<configdata>
 <navigation>

    <default>
        <label>Home</label>
        <controller>index</controller>
        <action>index</action>
        <module>default</module>
        
        <pages>
            <tour>
                <label>Tour</label>
                <controller>tour</controller>
                <action>index</action>
                <module>default</module>
            </tour>
            
            <blog>
                <label></label>
                <uri>http://blog.mysite.com</uri>                   
            </blog>
            
            <support>
                <label>Support</label>
                <controller>support</controller>
                <action>index</action>
                <module>default</module>
            </support>
        </pages>
     </default>
     
     <users>
        <label>Home</label>
        <controller>index</controller>
        <action>index</action>
        <module>users</module>
        <role>guser</role>
        <resource>owner</resource>
        
        <pages>
            
            <jobmanger>
                <label>Job Manager</label>
                <controller>jobmanager</controller>
                <action>index</action>
                <module>users</module>
                <role>guser</role>
                <resource>owner</resource>
            </jobmanger>
            
            <myaccount>
                <label>My Account</label>
                <controller>profile</controller>
                <action>index</action>
                <role>guser</role>
                <resource>owner</resource>
                <module>users</module>
                <pages>
                    
                    <detail>
                        <label>Account Details</label>
                        <controller>profile</controller>
                        <action>detail</action>
                        <module>users</module>
                        <role>guser</role>
                        <resource>owner</resource>
                        
                        <pages>
                            <history>
                                <label>Account History</label>
                                <controller>profile</controller>
                                <action>history</action>
                                <module>users</module>
                                <role>guser</role>
                                <resource>owner</resource>
                            </history>
                            
                            <password>
                                <label>Change Password</label>
                                <controller>profile</controller>
                                <action>changepwd</action>
                                <module>users</module>
                                <role>employer</role>
                                <resource>employers</resource>
                            </password>
                        </pages>
                    </detail>

...
</navigation>
</configdata>

我将这一xml装入boot锁如下:

 $configNav = new Zend_Config_Xml( ../application/config/navigation.xml ,  navigation );
 $navigation = new Zend_Navigation($configNav);
 $navView->navigation($navigation);

现在,我承认,我完全怀着这一 stick子的错误结束,但迅速摆脱了思想,并且是一个漫长的星期。

感谢

赠款

最佳回答

Zend_Navigation似乎是通过检查控制器、行动器和模块钥匙的存在,确定是否使用Mvc页面或Uri页面。 如果不符合上述条件,你就会重报错误。 您的XML文件中的所有例子都看重罚款,因此,我猜测,在XML档案中,你没有哪一点需要你一页的钥匙。 例如,你有行动和控制器,但没有模块。

如果你没有能够发现谁是造成这一问题的,我建议暂时在Zed_Navigation上添加一条 de线,插入:

var_dump($options);exit;

进入Zentd/Navigation/Page.php第222条。 这将勾画出造成错误的要素的关键,这应当有助于你在你的XML中找到。 一旦你确定,这条线就会再次拆除!

问题回答

我最近还意外地在其中一页中增加了两个条目。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签