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
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- Guite responded to »Remove contents of nuke_sc_anticracker from Database« 01:30 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
- jmvaughn responded to »PN 0.764 to Zikula 1.1.2 (migration) Internal Server Error« 08. Feb
- eledril created topic »Where can I download BBCode and BBSmile?« 08. Feb
- Paustian responded to »Need Feedback« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Clearing pnRender caches using hooks?
-
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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
Users on-line
This list is based on users active over the last 60 minutes.
