ModifierTest01
構成
$MT_DIR/
|__ plugins/
| |__ ModifierTest01/
| |__ config.yaml
| |__ lib/
| | |__ ModifierTest01
| |__ Tag.pm
ソース
config.yaml
id: ModifierTest01
key: ModifierTest01
name: ModifierTest01
tags:
function:
ModifierFuncTest01: $ModifierTest01::ModifierTest01::Tag::_hdlr_function
modifier:
bold_on : $ModifierTest01::ModifierTest01::Tag::_hdlr_modifier
lib/ModifierTest01/Tag.pm
package ModifierTest01::Tag;
use strict;
# モディファイア
sub _hdlr_modifier{
# 引数
my ($text, $arg, $ctx) = @_;
# 引数を取得できない場合はそのまま抜ける
if(!$arg){
return $text;
}
# 値編集
my $res_text = "<strong>$text</strong>";
# 返却
return $res_text;
}
# ファンクションタグ
sub _hdlr_function{
# 引数を取得
my ($ctx, $args) = @_;
# 結果を返却
return "ModifierTest01";
}
1;
最終更新:2012年03月08日 23:44