Schrift

Creating Modules

Creating a Module called Foo

Templates

Create

Module

Create lib/WWW/Battie/Modules/Foo.pm

lib/WWW/Battie/Modules/Foo.pm

package WWW::Battie::Modules::Foo;
use strict;
use warnings;

use Carp qw(carp croak);
use base qw/ WWW::Battie::Module::Model Class::Accessor::Fast /;

my %functions = (
    functions => {
        foo => {
            start   => 1,
            init    => {
                on_run => 1,
            },  
        },  
    },  
);  

sub functions { %functions }

sub default_actions {
    my ($class, $battie) = @_;
    return {
        guest => [qw/ start /],
        user => [qw/ /],
    };  
}   
sub model {
    foo => 'WWW::Battie::Schema::Foo',
}

sub title {
    return 'Foo'
}

sub foo__start {
}

1;

Schema

Create lib/WWW/Battie/Schema/Foo.pm

to be continued...


Created at 2010-02-24 19:58
Last modified at 2010-02-24 19:58