NacoWiki PHP API

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 in cfg[plugins][PluginVars] (as a YAML document)
    • $ cfg.key$: values in the cofg 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 by NacoWiki.
    • $ key$ : Additional variables as defined in cfg[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
phpcod

PluginVars

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
event

cli:gvars

phpcod

commands##cfg

Return values
bool|null

dumpVars()

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
event

cli:gvars

phpcod

commands##gvars

Return values
bool|null

load()

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>

        
On this page

Search results