Plugin API
The Plugin API provides a collection of services for use by Siteframe plugins. The API is implemented as a PHP class file and classes are called directly, not through the creation of an object. This page defines the functions available in the plugin API and shows examples of their use.
Please note that the Plugin API is a PHP5 API for use by plugin scripts; this is distinct from the Siteframe API, which is a web services interface for accessing site resources remotely.
Plugin::add_property(class, name, definition)
This function defines a new property name associated with a specific class. The property definition follows the form of a Siteframe metadata specification array. Once the property is defined and the plugin is activated, the property is indistinguishable from any other properties associated with the class. For example, if you wanted to collect information on the camera used to create an image, you could use a plugin that contains this function call:
Plugin::add_property('File', 'camera_info', array('type' => 'text', 'maxlength' => 50, 'prompt' => 'Camera'));
This defines a new property named camera_info that is stored as a text field 50 characters long.
