Forum Activity

Forum feed

Clearing pnRender caches using hooks?  Top

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

This list is based on the users active over the last 60 minutes.