[Catalyst] questions about Hops demo

Sebastian Riedel sri at oook.de
Thu Jun 16 18:54:01 CEST 2005


Am 16.06.2005 um 14:47 schrieb samwyse:
> 1)  In catalyst/hops/lib/Hops/M/CDBI.pm, additional classes are loaded
> in two different ways:
>
> + # Declare additional classes.
> + use Class::DBI::Loader::Relationship;
> + use Class::DBI::AsForm;
> + use Class::DBI::FromForm;
> + use Class::DBI::Plugin::RetrieveAll;
> +
>   __PACKAGE__->config(
> !     # Declare additional classes.
> !     additional_classes => [ qw/
> !         Class::DBI::Plugin::RetrieveAll
> !     Class::DBI::Plugin::AbstractCount
> !     Class::DBI::Plugin::Pager
> !     / ],
>
> What's the difference (if any) between these two methods?

First requires and imports into the shared base class, second  
generates code to use classes in every table class.

>
> 2)  Looking at the templates, there's obviously hooks for additional
> useful functionality.  For example, when you look at a single beer,
> you'd like to see the pubs that serve it.  I'd like to get this
> working, but can't figure out how to get $class->meta_info("has_many")
> into the template.  Should I be putting something into the stash, or
> is there enough stuff there already and I just haven't found it yet?

I'd prefer the stash, but TIMTOWTDI... ;)

--
sebastian




More information about the Catalyst mailing list