helper

PACKAGE->config( name => 'AdminPage',

    authentication => {
        dbic => {
            user_class         => 'AdminPage::Model::DBIC::Account',
            user_field         => 'username',
            password_field     => 'password',
            password_type      => 'hashed',
            password_hash_type => 'MD5',
        },
    },

    authorization => {
        dbic => {
            role_class           => 'AdminPage::Model::DBIC::Role',
            role_field           => 'role',
            role_rel             => 'map_account_role',
            user_role_user_field => 'account',
        },
    },

    session => {
        expires => 3600 * 14,
        storage => __PACKAGE__->path_to( 'session', 'session' )->stringify,
        cookie_name => 'ap_sid',
    },

    validator => {
        plugins        => [qw/DBIC::Unique/],
        options        => { dbic_base_class => 'AdminPage::Model::DBIC', },
        messages       => __PACKAGE__->path_to('validator.yml')->stringify,
        message_format => qq{<span class="error">%s</span>},
    },

    'View::TT' => {
        CONTEXT     => undef,
        PRE_PROCESS => 'inc/macro.tt',
    },
);

こんな config をちょくちょく書くんだけど、いまいちうまくヘルパーつくれなくてめんどいのよね。ううう。

なんつか、もうちょいアプリかかないとどこが共通でどこが変わるかとかがうまくわからんよ。パターん

by typester / at 2005-12-31T04:53:00 / life · perl / Comments(0)