BlockTest02

構成

$MT_DIR/
|__ plugins/
|  |__ BlockTest02/
|     |__ config.yaml
|     |__ lib/                    
|     |  |__ BlockTest02
|            |__ Plugin.pm
 
 
 

ソース

config.yaml

id: block02
key: BlockTest02
name: BlockTest02
tags:
    block:
        BlockTest02: $BlockTest02::BlockTest02::Plugin::hdlr_func02
 
 

lib/BlockTest02/Plugin.pm

package BlockTest02::Plugin;
 
use strict;
 
sub hdlr_func02{
 
    # 引数を取得
    my ($ctx, $args, $cond) = @_;
 
    my $builder = $ctx->stash('builder');
    my $tokens  = $ctx->stash('tokens');
    my $loop = $args->{count} || 1;
    my $html = '';
 
    for (my $count = 1; $count <= $loop; $count++) {
        my $out = $builder->build ($ctx, $tokens, $cond);
        return $ctx->error ($builder->errstr) if !defined $out;
        $html .= $out;
    }
    return $html;
}
 
1;
 
 



最終更新:2012年01月25日 01:11