Class::DBI::Plugin::Param - Adding param() method to your CDBI object.


Class-DBI-Plugin-Param documentation  | view source Contained in the Class-DBI-Plugin-Param distribution.

Index


NAME

Top

Class::DBI::Plugin::Param - Adding param() method to your CDBI object.

VERSION

Top

Version 0.02

SYNOPSIS

Top

Just use this module in your subclass of CDBI.

    package MyApp::DBI;
    use base 'Class::DBI';

    use Class::DBI::Plugin::Param; # just use

    MyApp::DBI->connection(
        ...
    );

    package MyApp::Music
    use base 'MyApp::DBI';
    ...

    # in your script
    my $music = MyApp::Music->retrieve($id);
    print $music->param('title');
    $music->param(title => 'Waltz For Debby');

Or use the 'additional_classes' option with Class::DBI::Loader.

    use Class::DBI::Loader;
    my $loader = Class::DBI::Loader->new(
        ...
        additional_classes => qw/Class::DBI::Plugin::Param/
    );

DESCRIPTION

Top

This module allows you to add param() method to your Class::DBI object. This makes it easier to pass your object to HTML::FillinForm / Template::Plugin::FillInForm / HTML::Template like this:

    my $music = MyApp::Music->retrieve($id);
    my $fif = HTML::FillInForm->new;
    my $output = $fif->fill(
        scalarref => \$html,
        fobject => $music
    );

    # OR
    [% USE FillInForm %]
    [% FILTER fillinform fobject => music %]
    <form method="get">
        ...
    </form>
    [% END %]

    # OR
    my $template = HTML::Template->new(
        filename => 'template.tmpl',
        associate => $music,
    );

FUNCTIONS

Top

param

Gets/Sets the parameters.

AUTHOR

Top

Naoya Ito, <naoya at bloghackers.net>

BUGS

Top

Please report any bugs or feature requests to bug-class-dbi-plugin-param at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-DBI-Plugin-Param. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Class::DBI::Plugin::Param

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Class-DBI-Plugin-Param

* CPAN Ratings

http://cpanratings.perl.org/d/Class-DBI-Plugin-Param

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-DBI-Plugin-Param

* Search CPAN

http://search.cpan.org/dist/Class-DBI-Plugin-Param

COPYRIGHT & LICENSE

Top


Class-DBI-Plugin-Param documentation  | view source Contained in the Class-DBI-Plugin-Param distribution.