Foorum::Controller::Get
Usually we write something like follows:
my $user = $c->model('DBIC::User')->get( { username => $username } ); $c->detach( '/print_error', ['ERROR_USER_NON_EXSIT'] ) unless ($user); if ( $user->{status} eq 'banned' or $user->{status} eq 'blocked' ) { $c->detach( '/print_error', ['ERROR_ACCOUNT_CLOSED_STATUS'] ); }
It's pretty trival to write it everywhere, and we can't put '/print_error' into Model/User.pm since we do not need to raise error every time. so I put it into Controller/Get.pm
so does forum, topic.
Fayland Lam <fayland at gmail.com>
To install Foorum, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Foorum
CPAN shell
perl -MCPAN -e shell install Foorum
For more information on module installation, please visit the detailed CPAN module installation guide.