1 Date: Wed, 19 May 2010 10:51:54 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415)
3 Content-Type: application/x-phpwiki;
4 pagename=HelloWorldPlugin;
8 lastmodified=1068935007;
13 Content-Transfer-Encoding: binary
17 <<HelloWorld salutation="Hello," name="WikiUser" >>
19 From the source of this page:
22 <<HelloWorld salutation="Hello," name="WikiUser" >>
26 PhpWiki 的 plugin 架構允許你加入自訂的頁面元素. 你所要做的就是繼承 ~WikiPlugin
32 * A simple demonstration WikiPlugin.
37 * salutation="Greetings, "
40 * <<HelloWorld salutation=Hi > >
41 * <<HelloWorld name=WabiSabi > >
44 // Constants are defined before the class.
45 if (!defined('THE_END'))
46 define('THE_END', "!");
48 class WikiPlugin_HelloWorld
51 // Five required functions in a WikiPlugin.
54 return _("HelloWorld");
57 function getDescription () {
58 return _("Simple Sample Plugin");
62 // Establish default values for each of this plugin's arguments.
63 function getDefaultArguments() {
64 return array('salutation' => "Hello,",
68 function run($dbi, $argstr, $request) {
69 extract($this->getArgs($argstr, $request));
71 // Any text that is returned will not be further transformed,
72 // so use html where necessary.
73 $html = HTML::tt(fmt('%s: %s', $salutation, WikiLink($name, 'auto')),