very new to plack and attempting to use perl and template tool kit with plack

29 views
Skip to first unread message

Joseph Norris

unread,
Nov 19, 2015, 4:52:25 PM11/19/15
to psgi-plack
Hello to all

I am working on an application that uses template toolkit and perl running under plack.  Here is my issue:

in standard perl/tt under CGI I was able to process a incrementing structure by loading up an array and the processing it through tt as:


sub new {
    my $class = shift;
    my $self  = {};
    bless ($self, $class);
    $self->_init( @_ );
    return $self;
}
sub _init{
    my ($self,%p) = @_;
    $self->{container} = [];
}


then down in the code

get db record - $rec

push @{$self->{container}}, $rec;

my $output = ''

$form->{array} = $self->{container};

$tt->prosess("$template,$form,\$output);

under plack - the $self->{container}  only gets the most recent $rec - it is like the array ref is lost and it starts fresh each time.

Can anyone give some guidance in this or examples of using template toolkit under plack.


Thanks to all.





Reply all
Reply to author
Forward
0 new messages