1 Date: Fri, 4 Feb 2011 16:44:25 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0)
3 Content-Type: application/x-phpwiki;
4 pagename=Help%2FHelloWorldPlugin;
8 lastmodified=1068935007;
12 Content-Transfer-Encoding: binary
16 <<HelloWorld salutation="Hello," name="WikiUser" >>
18 From the source of this page:
21 <<HelloWorld salutation="Hello," name="WikiUser" >>
25 PhpWiki 的 plugin 架構允許你加入自訂的頁面元素. 你所要做的就是繼承 ~WikiPlugin
31 * A simple demonstration WikiPlugin.
36 * salutation="Greetings, "
39 * <<HelloWorld salutation=Hi > >
40 * <<HelloWorld name=WabiSabi > >
43 // Constants are defined before the class.
44 if (!defined('THE_END'))
45 define('THE_END', "!");
47 class WikiPlugin_HelloWorld
50 // Five required functions in a WikiPlugin.
53 return _("HelloWorld");
56 function getDescription () {
57 return _("Simple Sample Plugin");
61 // Establish default values for each of this plugin's arguments.
62 function getDefaultArguments() {
63 return array('salutation' => "Hello,",
67 function run($dbi, $argstr, $request) {
68 extract($this->getArgs($argstr, $request));
70 // Any text that is returned will not be further transformed,
71 // so use html where necessary.
72 $html = HTML::tt(fmt('%s: %s', $salutation, WikiLink($name, 'auto')),
81 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]