Plugin: Application Plugin

Description Super class Active bindings Methods

Description

Plugins provide additional functionality to an App. These are the main mechanisms through which additional functionality is added, as opposed to using inheritance of the App object itself.

The Plugin interface is as follows:

Super class

webtools::Configurable -> Plugin

Active bindings

name

name of the plugin

requires

name(s) of plugins that are required by this plugin

app

attached app instance

fire

fire object attached to app instance

Methods

Public methods

Inherited methods

Method new()

Establishes initial configuration for the Plugin.

Usage
Plugin$new(name, requires = NULL)
Arguments
name

(str) name of the plugin

requires

(chr) additional plugin names that are required


Method on_attach()

on_attach(app, ...) should attach all the handlers, routers, and static paths necessary for this plugin. To make them easier to detach, add plugin == self$name to the metadata of the handlers.

Usage
Plugin$on_attach(app, ...)
Arguments
app

(App) instance

...

(arg)s passed to the underlying methods


Method on_detach()

(optional) should detach all the handlers, routers, and static paths for the plugin. By default it does this by just removing all the elements that have the plugin indicated via metadata.

Usage
Plugin$on_detach(app, ...)
Arguments
app

(App) instance

...

(arg)s passed to the underlying methods


Method clone()

The objects of this class are cloneable with this method.

Usage
Plugin$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


tjpalanca/webtools documentation built on Dec. 23, 2021, 11 a.m.