Sei in Home page » Prodotti » Opensource » CPAN » HTML::Template::Extension » Help on line

Soluzione integrata di telefonia su internet a banda larga.
Cerca su questo sito:  

Vuoi essere aggiornato in tempo reale su tutto quello che mi succede giorno per giorno?
Visita il mio nuovo blog

NAME

HTML::Template::Extension::HEAD_BODY - Plugins for html file


SYNOPSIS

 use HTML::Template::Extension;
 my $text = qq
    |
     <HTML>
        <HEAD>
            <SCRIPT Language="Javascript">
                function do_nothing {
                    return void;
                }
            </SCRIPT>
        </HEAD>
        <BODY backgroud="#FFFFFF">
            <H1>This is a template example...</H1>
                The sum between 1+1 is: <TMPL_VAR NAME="result">
        </BODY>
     </HTML>
    |;
 my $comp       = new HTML::Template::Extension(
                                            scalarref => \$text,
                                            plugins=>["HEAD_BODY"],
                                            );
 $comp->param('result' => 1+1);
 print $comp->output;
 #  OUTPUT:
 #
 #   <HTML>
 #      <HEAD>
 #              <SCRIPT Language="Javascript">
 #                      function do_nothing {
 #                              return void;
 #                      }
 #              </SCRIPT>
 #      </HEAD>
 #      <BODY backgroud="#FFFFFF">
 #              <H1>This is a template example...</H1>
 #                      The sum between 1+1 is: 2
 #      </BODY>
 #   </HTML>
 $comp->autoDeleteHeader(1);
 print $comp->output;
 #  OUTPUT:
 #
 #              <H1>This is a template example...</H1>
 #                      The sum between 1+1 is: 2
 print $comp->header;
 # OUTPUT:
 #
 #   <HTML>
 #      <HEAD>
 #              <SCRIPT Language="Javascript">
 #                      function do_nothing {
 #                              return void;
 #                      }
 #              </SCRIPT>
 #      </HEAD>
 #      <BODY backgroud="#FFFFFF">
 print $comp->js_header;
 # OUTPUT:
 #
 #              <SCRIPT Language="Javascript">
 #                      function do_nothing {
 #                              return void;
 #                      }
 #              </SCRIPT>


DESCRIPTION

This plugin add nothing syntax to HTML::Template but add some methods usefull for parsing html template in an environment where web pages are built embedding more little html templates (have you see my HTML::Puzzle CPAN module?).

It add a costructor parameter ``autoDeleteHeader'' that, is set to 1, automatically remove html header returning only html code inside BODY tag.

If you have see HTML::Template::Extension::CSTART plugin this is equivalent to

 <HTML>
        <HEAD>
        </HEAD>
        <BODY>
                <TMPL_CSTART>
                ...
                </TMPL_CSTART>
        </BODY>
 </HTML>

But more than this a ``header'' method will be added to return removed header.

It also have a ``js_header'' method to return javascript code present in the header.


AUTHOR

Bruni Emiliano, <info@ebruni.it>


SEE ALSO

 HTML::Template
 HTML::Template::Extension::DO_NOTHING
 HTML::Template::Extension::SLASH_VAR
 HTML::Template::Extension::CSTART
 HTML::Template::Extension::DOC
 HTML::Template::Extension::HEAD_BODY
JavaScript Menu Courtesy of Milonic.com




Commenti
Lascia un commento

Nome e Email sono obbligatori (l'email non verrą mostrato). L'URL č opzionale. I commenti non appariranno subito in quanto sono sottoposti a moderazione.

Sono accettati questi TAG: <A>, <STRONG>, <B>, <EM>

ome
Nessun commento č stato ancora inserito. Che ne diresti di essere tu il primo?

 Copyright© 1997-2006 Emiliano Bruni Online dal 16/08/1998 con visitatori Scrivimi all'indirizzo: