Cmd-Dwarf

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

        <meta name="description" content="">
        <meta name="author" content="">

        <!-- Le styles -->
        <link href="/dwarf/bootstrap/css/bootstrap.css" rel="stylesheet">
        <style>
            body {
            padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
            }
        </style>
        <link href="/dwarf/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
    </head>

    <body>
        <div class="container">

        <h1>400 Bad Request</h1>
    : if $error {
        <!-- error messages -->
        <dl class="alert">
            <dt>入力内容に不備がありました。</dt>
            <dd>
                <ul>
    : if $error.category.UINT {
                    <li>種別は必須項目です。選択してください。</li>
    : }
    : if $error.name.NOT_NULL {
                    <li>商品名・邸名は必須項目です。入力してください。</li>
    : }
    : if $error.introduction.NOT_NULL {
                    <li>紹介文は必須項目です。入力してください。</li>
    : }
                </ul>
            </dd>
        </dl>
    : }

        </div> <!-- /container -->
    </body>
    </html>

## Dwarf::Pragma

use すると基本的なプラグマをまとめてセットするショートカットの役割をするクラスです。

        use strict;
        use warnings;
        use utf8;
        use feature '5.10';
        use boolean;

オプションで utf8 と feature の挙動は変更することが出来ます。

        sub import {
                my ($class, %args) = @_;

                $utf8 = 1 unless defined $args{utf8};
                $feature = "5.10" unless defined $args{feature};

                warnings->import;
                strict->import;
                boolean->import;
                boolean->export_to_level(1);

                if ($utf8) {
                        utf8->import;
                }

                if ($feature ne 'legacy') {
                        require 'feature.pm';
                        feature->import(":" . $feature);
                }
        }

## Dwarf::Accessor

アクセサを作成するためのクラスです。

### Lazy Initialization

「\_build\_ + プロパティ名」というメソッドを実装することで、初期値を遅延生成することが出来ます。

        use Dwarf::Accessor qw/json/;

        sub _build_json {
                my $json = JSON->new();
                $json->pretty(1);
                $json->utf8;
                return $json;
        }

## Dwarf::Message

ディスパッチ処理の中で送出可能なメッセージクラス。主にフレームワークがエラーハンドリングなどに利用している。not\_found メソッドや redirect メソッドが利用している finish メソッãƒ...

## Dwarf::Trigger

トリガークラス。Dwarf が提供しているトリガーは BEFORE\_DISPATCH / AFTER\_DISPATCH / ERROR / SERVER\_ERROR の四種類。また、Dwarf::Plugin::Text::Xslate などのプラグインは読み込まれると BEFORE\_RENDER / AFTER\...

        $c->add_trigger(BEFORE_RENDER => $self->can('will_render'));
        $c->add_trigger(AFTER_RENDER => $self->can('did_render'));
        $c->add_trigger(ERROR => $self->can('receive_error'));
        $c->add_trigger(SERVER_ERROR => $self->can('receive_server_error'));

## Dwarf::Util

ユーティリティクラス。以下のメソッドが @EXPORT\_OK である。

### メソッド

#### add\_method

#### load\_class

#### installed

#### capitalize

#### shuffle\_array

#### filename



( run in 2.163 seconds using v1.01-cache-2.11-cpan-5735350b133 )