Am Wednesday, 28. May 2003 19:04, schrieb Christopher B. Liebman:
> I'm putting a DB application togeather and am creating my own taglib
> specific to the app.  I want to have a set of tags like: (these are not the
> exact tags I want, just something to get the idea across)
>
>
> <tag:items>
>    <xxx><tag:value name="xxx"></xxx>
> </tag:items>
>
> I want the tag:iems to loop over a set of wors returned from the database.
> I have played around with this a bit and have not been successful getting
> anything but compilation errors with my attemps to loop.  Has anyone done
> anything lke this with SimpleTaglibs?

You could do it roughly along these lines: (this assumes you have $my_sth 
already set up and executed correctly - if not, do so right in front of the 
"while")

sub items__open {
        return 'while (my $my_database_row = $my_sth->fetchrow_hashref) {';
}

sub items {
        return '}';
}

sub items___value : attribOrChild(name) {
        return '$my_database_row->{$attr_name}';
}

-- 
CU
   Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to