Query: text::micromason::allowglobals
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MicroMason::AllowGlobals(3pm) User Contributed Perl Documentation MicroMason::AllowGlobals(3pm)NAMEText::MicroMason::AllowGlobals - Share package vars between templatesSYNOPSISInstead of using this class directly, pass its name to be mixed in: use Text::MicroMason; my $mason = Text::MicroMason->new( -AllowGlobals ); Share package variables: $mason->set_globals( '$name' => 'Bob' ); Use the standard compile and execute methods to parse and evalute templates: print $mason->compile( text=>$template )->(); print $mason->execute( text=>$template ); Then, in a template, you can refer to those globals: Welcome, <% $name %>!DESCRIPTIONPublic Methods set_globals() Accepts a list of pairs of global variable names and corresponding values. Adds each variable name to the allowed list and sets it to the initial value. allow_globals() Gets or sets the variables names to be allowed. If called with arguments, adds them to the list. Returns the variables to be allowed as a list, or as a space-separated string in scalar context. Supported Attributes allow_globals Optional array or space-separated string of global variable names to be allowed. Private Methods assemble() Adds the allow_globals_statement to each token stream before assembling it. allow_globals_statement() This method prepends the "use vars" statement needed for the template subroutines to compile.SEE ALSOFor an overview of this templating framework, see Text::MicroMason. This is a mixin class intended for use with Text::MicroMason::HTMLMason. For distribution, installation, support, copyright and license information, see Text::MicroMason::Docs::ReadMe. perl v5.10.1 2007-01-29 MicroMason::AllowGlobals(3pm)
Similar Topics in the Unix Linux Community |
---|
#!/bin/sh shell question |
Which Files To Share WIth CSM? |
Passing shell variables to a webpage |
Help with perl subroutines |
Creating a .profile, displaying system variables, and creating an alias |