Daniel Ruoso > Oak-Web-1.8 > Oak::Web::Additional::Template

Download:
Oak-Web-1.8.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

Oak::Web::Additional::Template - Component for adding free text

DESCRIPTION ^

This module will be used to insert free text inside your web page. It will substitute text enclosed by <% and %> with the key setted in the __VARS__ property.

HIERARCHY ^

Oak::Object

Oak::Persistent

Oak::Component

Oak::Web::Visual

Oak::Web::Additional::Template

PROPERTIES ^

type

file or string. If type eq file, it will try to open the source and use it. Else it will print the source.

source

This property indicates where is the source file to be printed or if the type is string, the code itself.

__VARS__

There is a shortcut method to set this, set_vars. This property contains a hashref to the list of variables to be substituted.

METHODS ^

set_vars(HASH)

Define the variables that will be used for substitution in the template.

EXCEPTIONS ^

The following exceptions are introduced by Oak::Web::Additional::Template

Oak::Web::Additional::Template::Error::FileNotFound

When source file is not found this error is thrown

EXAMPLES ^

  text.htm
  -----------
  Hi <%fullName%>,
  
  It is a pleasure to meet you.
  
  
  Cheers
  -----------
  
  The method set_vars will receive a hash with the variables to
  be substituted.
  When you want to substitute some variable put its name between <% and %>

COPYRIGHT ^

Copyright (c) 2001 Daniel Ruoso <daniel@ruoso.com> All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.