While working my way through the 0.762 Example module (assisted by Johnny Birchett's fabulous walk-through), I noticed there's code in the admin API functions to clear the appropriate pnRender cache after an item is updated or deleted. This seems to break the otherwise clean separation between GUI and API modules, as the cache is a presentation-layer (GUI) object. Wouldn't it be cleaner to clear the caches thru a corresponding hook function (item update, item delete)? That way the API stays "pure" of GUI coupling -- it just calls the hooks as it currently does, without any explicit reference to a rendering object. Anything I'm missing about hook functions?
pch
edited by: halversp, May 09, 2006 - 10:03 PM
- pborchelt answered »HowtoPNForms module unable to find template« 03:52h
- Teb answered »MenuTree Mystery« 05. Jul
- dks answered »include a file« 05. Jul
- dks answered ».764 -> 1.1.1, Can't add new blocks« 05. Jul
- craigh posted »PostCalendar 5.5.0RC1 needs testers and translators« 05. Jul
- bartl answered »Upgrading 1.0.2 --> 1.1.1« 05. Jul
- Charlie-otb answered »SafeHTML output filter and youtube« 05. Jul
Login
Clearing pnRender caches using hooks?
-
- Rank: Freshman
- Registered: 06.05.06
- last visit: 10.05.06
- Posts: 3
-
- Rank: Moderator
- Registered: 19.03.02
- last visit: 27.06.09
- Posts: 7661
While a hook function could be used this creates additional work. Say we put the caching clearing into the pnRender module as a hook. The pnRender module would need it's hooks activating for every module.
IMO this doesn't really break the seperation since the API doesn't actually perform any real output just manages the cache.
-Mark
--
Visit My homepage and Zikula themes.
- Moderated by :
- Support
