Apache2-Controller

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.101.101   2008-07-22T02:30:00
            Version numbers are so strange.

0.4.3   2008-07-21T00:22:00
        Removed ability to limit methods.  Use Apache config for that.
        A2C:SQL::Controller.  untested.   Controller now passes @path_args
        as arguments to method.  Version is now in its own package.
        Some new SQL-related packages that may or may not work.
        Universal use of Apache2::Controller::Directives - no more
        PerlSetVar.  Documentation edits.

0.4.1   2008-07-16T00:16:00
        Changing version number to use 'version' package.
        I had the version number screwed up before.
        The numbers below are actually 0.4.0, 0.3.0 etc.

0.0.4   2008-07-16T00:08:00
        New dispatch method HashTree implements alternative dispatching.
        Various improvements to documentation.  More tests.
        Developed unit test infrastructure.

lib/Apache2/Controller/Render/Template.pm  view on Meta::CPAN

 );

 use Apache2::Const -compile => qw( HTTP_OK );

 sub allowed_methods {qw( default )}

 sub default {
    my ($self, @first, @last) = @_;
    my @path_args = $self->my_detaint_path_args('name'); # from $self->{path_args}

    $self->{stash}{creditcards} = $self->pnotes->{a2c}{dbh}->fetchall_arrayref(
        q{  SELECT ccnum, exp, addr1, zip, cac 
            FROM customer_credit_cards 
            WHERE lname = ? AND fname = ?
        }, undef, @path_args
    );

    # request was like http://myserver.xyz/foo/Larry/Wall

    $self->render();    # renders /var/myapp/templates/foo/default.html
    return Apache2::Const::HTTP_OK;

 }

 __END__
 [%# /var/myapp/templates/foo/default.html %]
 <p>Here is the credit card info you requested for 
 everyone named [% path_args.reverse.join(' ') %]:</p>
 <ul>
 [% FOREACH card = creditcards %]
    [% FOREACH field = ['ccnum','exp','addr1','zip','cac'] %]
    <li><strong>[% field %]:</strong> [% card.$field %]</li>
    [% END %]
 [% END %]
 </ul>
 [%# end template toolkit file %]


=head1 DESCRIPTION



( run in 0.499 second using v1.01-cache-2.11-cpan-de7293f3b23 )