Passing parameters in breadcrumbs

I'm still a relative newbie to the Zend Framework, so please forgive me if this is a stupid question!

I use the breadcrumbs view helper in the main application layout to provide the usual functionality. However, I really need crackers to contain the parameters passed to the actions that the user clicked ...

Thus, if you go through "/ controller / parent / id / 1" to "/ controller / child / id / 2", the groove on the child page should return to "/ controller / parent / id / 1" and not just " / controller / parent / "

What are my options? Do I need to build a Zend_Navigation tree with all the contents of my database so that all possible identifiers for each action are satisfied? Or can I write my own helper to add additional parameters to the Zend_Navigation_Page object when rendering breadcrumbs?

The first option is the path of least resistance, but it feels very inefficient! Although, I suppose, this can be done with lazy loading to reduce memory usage.

Thanks for any help!

Tom

+3
source share
1 answer

I think the answer is to use reset_params in your navigation.xml file

reset_params = 0 :

<reset_params>0</reset_params>

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

, - :

<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>

+2

Source: https://habr.com/ru/post/1724397/


All Articles