Plugin system

2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 23, 2009   (RSS)

Re: [pothompson] Plugin system

By Dave - October 23, 2009

Hi Paul,

They are very similar. The only difference is hooks called with applyFilters() expect something to be return()'ed. So we pass content to the hook as the first argument and then expect it back. Where as actions just run code and ignore the return() value.

Filters let you modify or add content to some existing content, and actions let you run some arbitrary code. For your purposes addAction() would work fine.

Also, in schemaDumper.php, this line should actually be:
addAction('plugin_actions', 'schemaDumper_addPluginAction');
Since the code that calls it is: doAction() and not doFilter(). (I've updated that in the code).

Hope that all makes sense. Let me know if you have any other questions about any of that.
Dave Edis - Senior Developer
interactivetools.com