0
votes

I have a Zend app with two different modules (admin and nonadmin) The layout is like so:

app
|-- Bootstrap.php
|-- settings
|   `-- application.ini
`-- modules
   |-- adm
   |   |-- controllers
   |   `-- views
   |       `-- scripts
   |           `--index
   |-- nonadm
   |   |-- controllers    
   |   `-- views
   |       `-- scripts
   |            `--index
    `-- default
        `-- views
            `-- scripts
                |-- index
                `-- layout.phtml   

Every request whether it be from adm or nonadmn gets rendered inside the layout.phtml

So at the minute going to the admin module shows a bunch of jquery tabs which are loaded from the index.phtml file in the index view scripts folder for the admin module, to get to other tabs you need to first go to the index and then click a tab there.

Each tab is initially populated from the adm index controller. This means you can go directly to a tab from the offest.

I want to change the setup to make this possible.

So if I were to go to adm/somecontroller/indexaction, I would be directed to the correct tab and only that tabs content would be loaded.

So I understand I need view script with the empty tabs in it, which should get rendered whatever admin controller is used. The controller will populate the tab I am visiting and subsequent clicks on other tabs will cause ajax loads to the content for that tabs from a different controller.

How do I always load this tabs phtml file whatever controller is used?

And how do I auto load it into the layout.phtml script?

1

1 Answers

-1
votes

You can create a layout that has these tabs in them and make all the controllers/actions use this layout so that no matter what, the tabs get rendered and in turn, the content is loaded in the right place.