Hello all!

I need a Perl regular function exists in template processing.
I write application with different access level. Applicaion knows
which data should be passed to template depending on logged user. I
build SQL query kinda
my $sql = "select ";
$sql .= 'first_field,' unless ($deny{first_field});
...
$sql .= " from ...";
$return_to_template->{rows} =
$sth->selectall_arrayref($sql,{Columns=>{}});
and in template (I tried to use defined method, but it doesn't solve
the problem)

[% FOREACH row = rows %]
  [% IF row.first_field.defined %]
<input type="text" name="first_field" value="[% row.first_field %]">
  [% END %]
[% END %]

If field in SQL table is null and it is present in hashref then input
field doesn't appear and even manager can't modify it.

How to workaround this problem?
Do you think this regular perl function is unnecessary in TT ??
--------------------------------------------
Sergey Polyakov               aka "BeerBong"
Chief of WebZavod     http://www.webzavod.ru
Tel. +7 (8462) 43-93-85 | +7 (8462) 43-93-86
mailto:[EMAIL PROTECTED]





Reply via email to