[cgiapp] RFC: Module::Starter::Plugin::CGIApp

Jaldhar H. Vyas jaldhar at braincells.com
Sun Mar 23 22:30:32 EDT 2008


On Mon, 24 Mar 2008, Ron Savage wrote:

>
> In this doc:
> http://search.cpan.org/~jaldhar/Module-Starter-Plugin-CGIApp-0.01/lib/Module/Starter/Plugin/CGIApp.pm
> I was confused by $data_item. What is it? I did search some other
> modules you refer to, but didn't find any explanation.

I was wondering if I had I had explained that properly.  Basically the 
problem is that HTML::Template wants lists of hashes for tmpl_loops.  So 
if you have  $data = ['a', 'b', 'c'];  it would get converted to

$data = [
    { data_item => 'a' },
    { data_item => 'b' },
    { data_item => 'c' },
];

so that in the template you could say

<tmpl_loop data>
     <tmpl_var data_item>
</tmpl_loop>

In retrospect I should have used foo or something instead of data to 
indicate it is just an example.

-- 
Jaldhar H. Vyas <jaldhar at braincells.com>


More information about the cgiapp mailing list