Use this template to extend the kirbytext class with your own tags. Put this into site/plugins and name it kirbytext.php or kirbytext.extended.php
Forked from bastianallgeier/kirbytext.extended.php
Last active
September 6, 2015 09:04
-
-
Save float-mode/9f1b195bd7168ce470e4 to your computer and use it in GitHub Desktop.
A template to extend the kirbytext class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class kirbytextExtended extends kirbytext { | |
function __construct($text, $markdown=true) { | |
parent::__construct($text, $markdown); | |
/* | |
// define custom tags | |
$this->addTags('mynewtag', 'anothertag'); | |
// define custom attributes | |
$this->addAttributes('mynewattribute', 'anotherattribute'); | |
*/ | |
} | |
/* | |
// define a function for each new tag you specify | |
function mynewtag($params) { | |
// do something with the passed params here. | |
} | |
*/ | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment