[Bio] / FigKernelPackages / TemplateObject.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/TemplateObject.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2, Fri Jul 28 04:36:59 2006 UTC revision 1.3, Sun Jul 30 08:14:35 2006 UTC
# Line 254  Line 254 
254      }      }
255  }  }
256    
257    =head3 append
258    
259    C<< $to->append($name, $html); >>
260    
261    Append HTML to a named variable. Unlike L</add>, this method will not destroy a
262    variable's existing value; instead, it will concatenate the new data at the end of the
263    old.
264    
265    =over 4
266    
267    =item name
268    
269    Name of the variable to which the HTML text is to be appended.
270    
271    =item html
272    
273    HTML text to append.
274    
275    =back
276    
277    =cut
278    
279    sub append {
280        # Get the parameters.
281        my ($self, $name, $html) = @_;
282        # Check the mode.
283        if ($self->mode) {
284            # Template mode, so we check for the variable.
285            my $hash = $self->{varHash};
286            if (exists $hash->{$name}) {
287                $hash->{$name} .= $html;
288            } else {
289                $hash->{$name} = $html;
290            }
291        } else {
292            # Raw mode.
293            push @{$self->{html}}, $html;
294        }
295    }
296    
297  =head3 titles  =head3 titles
298    
299  C<< to->titles($parameters); >>  C<< to->titles($parameters); >>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3