All pastes #771991 Raw Edit

Something

public text v1 · immutable
·published 2007-11-13 13:19 UTC
rendered paste body
From lib/MyApp/Controller/Root.pm:

sub list_posts :Args(0) :Path {
    my ($self, $c) = @_;
    my @posts :Stashed = $c->model('MyDBI')->get_modems();
    my $template :Stashed = 'allpost.tt2';
}


From lib/MyApp/Model/MyDBI.pm:

package MyApp::Model::MyDBI;

use strict;
use base 'Catalyst::Model::DBI';

__PACKAGE__->config(
    dsn           => 'dbi:mysql:dbname',
    user          => 'root',
    password      => '',
    options       => {},
);


sub get_modems {
    my ($self, $c) = @_;
    my $dbh = $c->model('MyDBI')->dbh;
}