Differences

This shows you the differences between two versions of the page.

caf:manual:plugins [2010/02/16 12:59]
82.243.209.240
caf:manual:plugins [2010/02/16 13:00] (current)
82.243.209.240
Line 108: Line 108:
==== Defining entrypoints ==== ==== Defining entrypoints ====
-There are 3 ways to hook to a plugin : +There are 3 ways to hook to a plugin: 
-  * "hook" : return a set of classes, implementing the correspond interface. **This is the recommended choice**.+  * "hook" : return a set of classes, implementing the corresponding interface. **This is the recommended choice**.
  * "hook_notify" : return a boolean. This is used for notification with the //notify// method.   * "hook_notify" : return a boolean. This is used for notification with the //notify// method.
  * "hook_message" : return multiple elements, by yielding them. This is achieved through the //query// method ;   * "hook_message" : return multiple elements, by yielding them. This is achieved through the //query// method ;
-Placing a hook is easy, just use one of the above methods, and document your interface :+Placing a hook is easy, just use one of the above methods, and document your interface:
  PluginMgr.hook("ca.core.inspector", IInspectorPlugin)   PluginMgr.hook("ca.core.inspector", IInspectorPlugin)
-The first argument is your hook's path. You should use "ca" as a prefix then :+The first argument is your hook's path. You should use "ca" as a prefix then:
  * "core", if your hook resides in the CA standard modules   * "core", if your hook resides in the CA standard modules
-  * "plugin", if your hooks comes from a plugin+  * "plugin", if your hook comes from a plugin
...and finally append your module's name ("inspector") ...and finally append your module's name ("inspector")
 
caf/manual/plugins.txt · Last modified: 2010/02/16 13:00 by 82.243.209.240
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki