DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:syntax_plugin_skeleton

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
devel:syntax_plugin_skeleton [2013-04-11 02:51] – old revision restored (2013/01/20 01:57) 180.149.8.105devel:syntax_plugin_skeleton [2022-08-14 16:13] (current) – fix handle/render syntax for newer DokuWiki versions 2a02:168:4a00:0:e61d:2dff:fe09:a3e0
Line 12: Line 12:
  */  */
  
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); 
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 
-require_once(DOKU_PLUGIN.'syntax.php'); 
  
 /** /**
Line 125: Line 122:
     * @static     * @static
     */     */
-    function handle($match, $state, $pos, &$handler){+    function handle($match, $state, $pos, Doku_Handler $handler){
         switch ($state) {         switch ($state) {
           case DOKU_LEXER_ENTER :            case DOKU_LEXER_ENTER : 
Line 160: Line 157:
     * @see handle()     * @see handle()
     */     */
-    function render($mode, &$renderer, $data) {+    function render($mode, Doku_Renderer $renderer, $data) {
         if($mode == 'xhtml'){         if($mode == 'xhtml'){
             $renderer->doc .= "Hello World!";            // ptype = 'normal'             $renderer->doc .= "Hello World!";            // ptype = 'normal'
Line 170: Line 167:
 } }
  
-//Setup VIM: ex: et ts=4 enc=utf-8 : 
-?> 
 </code> </code>
  
devel/syntax_plugin_skeleton.1365641473.txt.gz · Last modified: 2013-04-11 02:51 by 180.149.8.105

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki