Bruni Emiliano > HTML-Template-Pro-Extension-0.10 > HTML::Template::Extension::IF_TERN

Download:
HTML-Template-Pro-Extension-0.10.tar.gz

Annotate this POD

View/Report Bugs
Source   Latest Release: HTML-Template-Pro-Extension-0.11

NAME ^

HTML::Template::Extension::IF_TERN - Plugins that support ternary if operator ?..:..

SYNOPSIS ^

 use HTML::Template::Extension;

 my $text = qq
    |
     IF_TERN plugin example
     ========================
     If all is ok you can read this here --> %test?It works!!!:It's BAD%

    |;

 my $comp       = new HTML::Template::Extension(
                                            scalarref => \$text,
                                            plugins=>["IF_TERN"],
                        );

 $comp->param('test' => "1");
 print $comp->output;

 #   OUTPUT:
 #
 #   IF_TERN plugin example
 #   ========================
 #   If all is ok you can read this here --> It works!!!

DESCRIPTION ^

IF_TERN add syntax for the ternary operator bool_var?this_if_true:this_if_false.

So with this plugin you can use this syntax to insert a dynamical text:

 %bool_var%this_if_true:this_if_false%

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
syntax highlighting: