⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 helloworldplugin

📁 PhpWiki是sourceforge的一个开源项目
💻
字号:
Date: Sat, 15 Nov 2003 17:23:27 -0500Mime-Version: 1.0 (Produced by PhpWiki 1.3.5pre)Content-Type: application/x-phpwiki;  pagename=HelloWorldPlugin;  flags="";  author=test;  version=10;  lastmodified=1068935007;  author_id=test;  markup=2;  hits=10;  charset=UTF-8Content-Transfer-Encoding: binary簡單的範例 plugin.<?plugin HelloWorld salutation="Hello," name="WikiUser" ?>From the source of this page:<verbatim><?plugin HelloWorld salutation="Hello," name="WikiUser" ?></verbatim>-----PhpWiki 的 plugin 架構允許你加入自訂的頁面元素. 你所要做的就是繼承 ~WikiPlugin類別並實作你的 run() 方法./** * A simple demonstration WikiPlugin. * * Usage: * <?plugin HelloWorld?&gt; * <?plugin HelloWorld *          salutation="Greetings, " *          name=Wikimeister * ? > * <?plugin HelloWorld salutation=Hi ? > * <?plugin HelloWorld name=WabiSabi ? > */// Constants are defined before the class.if (!defined('THE_END'))    define('THE_END', "!");class WikiPlugin_HelloWorldextends WikiPlugin{    // Five required functions in a WikiPlugin.    function getName () {        return _("HelloWorld");    }    function getDescription () {        return _("Simple Sample Plugin");    }    function getVersion() {        return preg_replace("/[Revision: $]/", '',                            "\$Revision: 1.2 $");    }    // Establish default values for each of this plugin's arguments.    function getDefaultArguments() {        return array('salutation' => "Hello,",                     'name'       => "World");    }    function run($dbi, $argstr, $request) {        extract($this->getArgs($argstr, $request));        // Any text that is returned will not be further transformed,        // so use html where necessary.        $html = HTML::tt(fmt('%s: %s', $salutation, WikiLink($name, 'auto')),                         THE_END);        return $html;    }};?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -