Search Results

Search found 3 results on 1 pages for 'templatetoolkit'.

Page 1/1 | 1 

  • perl TemplateToolkit - Can't locate object method "new" via package

    - by simnom
    Hi, I have inherited a web project that is perl based and I'm attempting to set up a local testing server so changes can be made internally to the project. The server architecture Ubuntu 9.10 php 5.2.10 mysql 5.1.37 perl 5.10.0-24ubuntu4 All the dependent modules and packages are installed such as DateTime.pm, TemplateToolkit.pm but running the application throws the following error message: Can't locate object method "new" via package "Template" (perhaps you forgot to load "Template"?) at ../lib//KPS/TemplateToolkit.pm line 51 The code block that this refers to is: sub new { return Template->new( INCLUDE_PATH => $KPS::Config::templatepath, ABSOLUTE => 1, DEBUG => 1, ); } If anybody is able to shed any light on this or point me in the right direction it would be greatly appreciated. Thanks Simnom

    Read the article

  • How can I get elements out of an array with Template Toolkit?

    - by Przemek
    I have an array of Paths which i want to read out with Template Toolkit. How can I access the array Elements of this array? The Situation is this: my @dirs; opendir(DIR,'./directory/') || die $!; @dirs = readdir(DIR); close DIR; $vars->{'Tree'} = @dirs; Then I call the Template Page like this: $template->process('create.tmpl', $vars) || die "Template process failed: ", $template->error(), "\n"; In this template I want to make an Tree of the directories in the array. How can I access them? My idea was to start with a foreach in the template like this [% FOREACH dir IN Tree.dirs %] $dir [% END %]

    Read the article

  • What's the right way to display a DBIx::Class ResultSet in my Catalyst project that uses Template To

    - by Thelema
    Given a DBIx::Class resultset, for example: my $rs = $c->model("DB::Card")->search({family_name => "Smith"}); the tutorials I've read use the stash to pass an arrayref of rows: $c->stash->{cards} = [$rs->all]; This results in the query getting executed at this point, and the resulting objects stuffed into the stash, so they can be used in TemplateToolkit as: [% FOREACH card IN cards %] [% card.given_name %] [% card.family_name %] [%END%] Is there a proper way to have TT iterate over the rows as they get fetched from the DB?

    Read the article

1