PluginVars
in package
NacoWiki Vars Plugin
This plugin is used to render config and meta data on a page
This plugin is used to create text substitutions. There are two sets of substitutions. Substitutions done before and after rendering.
- Before rendering:
-
$ urls$
: Current url -
$ cfg$
: current configuration (as a YAML document) -
$ vars$
: current config variables defined incfg[plugins][PluginVars]
(as a YAML document) -
$ cfg.key$
: values in thecofg
table -
$ meta.key$
: values defined in the meta data block of the page. -
$ file.key$
: file system metadata (usually just the file time stamp). -
$ prop.key$
: File properties (managed byNacoWiki
. -
$ key$
: Additional variables as defined incfg[plugins][PluginVars]
-
- After rendering:
-
$ plugins$
an unordered HTML list containing loaded plugins. -
$ attachments$
an unordered HTML list containg links to the current document's attachments.
-
CLI sub-commands
This plugin registers two sub-commands:
-
cfg
: dumps current configuration -
gvars
: dumps defined global variables ad configured in[plugins][PluginVars]
.
Tags
Table of Contents
Constants
- VERSION = '2.0.0'
- var string
Methods
- dumpCfg() : bool|null
- Dump config
- dumpVars() : bool|null
- Dump global variables
- load() : void
- Loading entry point for this class
Constants
VERSION
var string
public
mixed
VERSION
= '2.0.0'
Methods
dumpCfg()
Dump config
public
static dumpCfg(NanoWikiApp $wiki, array<string|int, mixed> $argv) : bool|null
This implements the cli sub-command cfg
This shows current running configuration of the wiki.
Parameters
- $wiki : NanoWikiApp
-
running wiki instance
- $argv : array<string|int, mixed>
-
Command line arguments
Tags
Return values
bool|nulldumpVars()
Dump global variables
public
static dumpVars(NanoWikiApp $wiki, array<string|int, mixed> $argv) : bool|null
This implements the cli sub-command gvars
This will dump all the variables defined in the configuration of the wiki user cfg[plugins][PluginVars]
Parameters
- $wiki : NanoWikiApp
-
running wiki instance
- $argv : array<string|int, mixed>
-
Command line arguments
Tags
Return values
bool|nullload()
Loading entry point for this class
public
static load(array<string|int, mixed> $cfg) : void
Adds commands and event hooks implemented by this class
Parameters
- $cfg : array<string|int, mixed>