Class plugin

Description

Plugin class A plugin is something which can be used by the system to render content to be plugged into a webpage in any specified place.

The normal plugin just provides a receptacle for content, and which will be plugged in when the webpage is built. You can also specify a path of a file containing content, an object to render() content, or a function to return content. We can have multiple types of plugin:

  • Standard: Literal content as provided
  • Function: A function call which returns content
  • Object: An object which renders content
  • File: A file which contains content

Located in /plugin-defs.php (line 367)

RenderableObject
   |
   --page_section
      |
      --plugin
Variable Summary
Method Summary
 plugin plugin (string $pluginid, [string $content = ""])
 void add_content ([mixed $content = ""])
 string render ()
Variables
mixed $pluginid = "" (line 372)

ID or name of this plugin

mixed $plugin_contents (line 375)

Array of plugin content objects

Inherited Variables

Inherited from page_section

page_section::$content
page_section::$script
page_section::$scriptsrc
Methods
Constructor plugin (line 383)

Constructor Create a new plugin object.

plugin plugin (string $pluginid, [string $content = ""])
  • string $pluginid: ID of this plugin. Used to find plugin location
  • string $content: Content to put into this plugin location
add_content (line 398)

Allows adding of any type of content to the plugin. This could be

literal (string), a file path referencing a file full of content, or and object supporting render(), or the name of a function which is in scope. In the latter case, the function name is saved here, and will only be executed later on when plugins are rendered prior to sending the webpage. This allows 'late' content rendering.

void add_content ([mixed $content = ""])
  • mixed $content: Content to plug in: string, path, object or func name
render (line 428)

Returns the string which represents all of the content

types which have been stored in this plugin. Note that we do not differentiate between HTML or WML etc. since the content from our point of view is all generic at this stage. Hence we override the render() method, and not html() and/or wml().

  • return: Plugin content.
string render ()

Redefinition of:
RenderableObject::render()
Render output

Inherited Methods

Inherited From page_section

 page_section::page_section()
 page_section::add()
 page_section::add_named_script()
 page_section::add_popup_script()
 page_section::add_script()
 page_section::add_scriptsrc()
 page_section::clear()
 page_section::get_template()
 page_section::get_trimcontent()
 page_section::html()
 page_section::replace()
 page_section::script()
 page_section::wml()

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3