It's better when it's simple

User Tools

Site Tools


This is an old revision of the document!

Struct Plugin

Struct Plugin: Development Support

The Struct Plugin allows other plugin developers to hook into it's functionality, adding additional features.

Registering new Types

The plugin signals the PLUGIN_STRUCT_TYPECLASS_INIT event which can be intercepted by Action Plugins. There is no default action. The passed $data is an associative array listing the available Types and their respective classes. It looks like this:

    'Checkbox' => 'dokuwiki\\plugin\\struct\\types\\Checkbox',
    'Date' => 'dokuwiki\\plugin\\struct\\types\\Date',
    'DateTime' => 'dokuwiki\\plugin\\struct\\types\\DateTime',
    'Decimal' => 'dokuwiki\\plugin\\struct\\types\\Decimal',
    'Dropdown' => 'dokuwiki\\plugin\\struct\\types\\Dropdown',
    'Lookup' => 'dokuwiki\\plugin\\struct\\types\\Lookup',
    'Mail' => 'dokuwiki\\plugin\\struct\\types\\Mail',
    'Media' => 'dokuwiki\\plugin\\struct\\types\\Media',
    'Page' => 'dokuwiki\\plugin\\struct\\types\\Page',
    'Tag' => 'dokuwiki\\plugin\\struct\\types\\Tag',
    'Text' => 'dokuwiki\\plugin\\struct\\types\\Text',
    'Url' => 'dokuwiki\\plugin\\struct\\types\\Url',
    'User' => 'dokuwiki\\plugin\\struct\\types\\User',
    'Wiki' => 'dokuwiki\\plugin\\struct\\types\\Wiki',

Plugins may add their own Typeclass pairs here. The class name has to be fully qualified and needs to be loadable by DokuWiki's Autoloader. The class needs to inherit from AbstractBaseType or one of its subclasses.

Please refer to the existing types' source code to see how to implement your own type.

plugin/struct/devel.1478698649.txt.gz · Last modified: 2016-11-09 14:37 by grosse

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki