Php 在面包屑中传递参数
我还是Zend框架的新手,所以如果这是一个愚蠢的问题,请原谅我 我在应用程序的主布局中使用breadcrumbs视图帮助程序来提供常用的breadcrumb功能。但是,我确实需要面包屑来包含传递给用户单击的操作的参数 因此,如果您从“/controller/parent/id/1”单击到“/controller/child/id/2”,子页面上的面包屑应该链接回“/controller/parent/id/1”,而不仅仅是“/controller/parent/” 我有什么选择?我是否需要用数据库的全部内容构建Zend_导航树,以便满足每个操作的每个可能ID?或者,我可以编写自己的助手,在呈现面包屑时向Zend_Navigation_页面对象添加额外的参数吗 第一种选择似乎是阻力最小的路径,但感觉效率很低!尽管如此,我认为这可以通过延迟加载来减少内存使用 谢谢你的帮助Php 在面包屑中传递参数,php,zend-framework,breadcrumbs,Php,Zend Framework,Breadcrumbs,我还是Zend框架的新手,所以如果这是一个愚蠢的问题,请原谅我 我在应用程序的主布局中使用breadcrumbs视图帮助程序来提供常用的breadcrumb功能。但是,我确实需要面包屑来包含传递给用户单击的操作的参数 因此,如果您从“/controller/parent/id/1”单击到“/controller/child/id/2”,子页面上的面包屑应该链接回“/controller/parent/id/1”,而不仅仅是“/controller/parent/” 我有什么选择?我是否需要用数据
Tom我认为答案是使用navigation.xml中的reset_参数 在页面内,您需要如下设置reset_params=0:
<reset_params>0</reset_params>
<config>
<nav>
<fsms>
<label>Home</label>
<module>default</module>
<controller>index</controller>
<action>index</action>
<pages>
<!-- Cases -->
<page_case>
<label>Case</label>
<module>case</module>
<controller>details</controller>
<action>index</action>
<reset_params>0</reset_params>
<pages>
<!-- Case Creation -->
<page_case_create>
<label>Creation</label>
<module>case</module>
<controller>create</controller>
<action>index</action>
</page_case_create>
</pages>
</page_case>
</pages>
</fsms>
</nav>
0
见:
例如,在我们的应用程序中,我们使用如下内容:
<reset_params>0</reset_params>
<config>
<nav>
<fsms>
<label>Home</label>
<module>default</module>
<controller>index</controller>
<action>index</action>
<pages>
<!-- Cases -->
<page_case>
<label>Case</label>
<module>case</module>
<controller>details</controller>
<action>index</action>
<reset_params>0</reset_params>
<pages>
<!-- Case Creation -->
<page_case_create>
<label>Creation</label>
<module>case</module>
<controller>create</controller>
<action>index</action>
</page_case_create>
</pages>
</page_case>
</pages>
</fsms>
</nav>
家
违约
指数
指数
案例
案例
细节
指数
0
创造
案例
创造
指数