|
Hi all, I need to include multiple controllers & views on a single page. Yes this sounded easy at first, especially after I read Creating Reusable Elements with requestAction until i found the possible overheads. This is what I'm trying to do: Build an application that allows the administrator to add order and move modules around on different parts of the application.... I have a couple of models for this. One is PortalTab, second is PortalModule and the third that ties these two is PortalTabsPortalModule a new module is registered into the portal by creating an entry for it in the portal_modules table. To make the module available for use, I put it in an existing portal_tab record( as in i insert portal_tab_id and the portal_module_id into the portal_tabs_portal_module table) . By visiting the tab using a controller action e.g /tabs/viewtab/13, tab with id of 13 has many modules attached to it, and displays them accordingly. A lot of thot has also gone into what part of the page which module shows and their order. (1) I have viewtab.ctp which has a loop that runs through the $modulesToLoad (e.g) variable and loads each one via AJAX . While this works quite well, the bad side to that the number of initial calls made to the server while it's loading via ajax: number of calls = the total number modules. I forsee having on the average 4/5 modules per tab group. Some may be just two. The project is growing quite fast especially with this mode of adding and working with modules dynamically, allowing the portal to have a loosely defined structure. I've also be able to effect calls using ajax and updating another block on the page. Apart from the overhead, what other possible failings does this method have? Otherwise, what do I do instead? Thanks! Femi TAIWO . |
- Best Practices - "Modular Blocks & Actions" Femi Taiwo
