CGI-Builder

 view release on metacpan or  search on metacpan

CBF_examples/05_TestCBF/var/www/cgi-bin/Test/tm/Form2.html  view on Meta::CPAN

<html>
<head>
<title>Form2</title>
</head>
<body bgcolor="lightblue">
<h1>Form 2</h1>
<form method="post" action="">
<input type="hidden" name="p" value="Form2_Res"><br>
email:<input name="email" type="text" value="<!--{email}-->"><span style="color:red;font-weight:bold"><!--{err_email}--></span><br>
city:<input name="city" type="text" value="<!--{city}-->"><span style="color:red;font-weight:bold"><!--{err_city}--></span><br>
<input type="submit" name="submit" value="Submit"><br>
</form>
</body>
</html>

lib/CGI/Builder.pm  view on Meta::CPAN

=head2 Global Variables Persistence

If you are using mod_perl, you should know the "Global Variables Persistence" issue: this is something that you must consider when your CBB is running under mod_perl, even when your CBB doesn't use Apache::CGI::Builder.

More explicitly you should know that the CBF and its extensions may use Global Variables to store certain data which are B<class scoped> (i.e. used for all the processes of your CBB class), thus caching the data and saving some processing.

The Global Variables that the CBF uses are always accessed by an OOTool accessor, they are just B<Class Accessors> instead of B<Object Accessors>: the behaviour of a Class accessors (property or group) is the same, but the underlaying accessed variab...

Examples of Class Accessors are the L<"Class Property Group Accessors"> of this module, or the C<tm>, C<tm_new_args> and C<tm_lookups_package> accessors of the CGI::Builder::Magic extension (which creates the Template::Magic object just once -the fir...

B<Note>: You should clearly distinguish the B<class accessors> among the others because this particular feature is usually written in B<bold> at the start of the accessor doc.

=head2 Advanced Methods

=head3 capture( CODE )

This method executes the I<CODE> (which can be a method name or a CODE ref) and returns a ref to the captured output, so allowing you to eventually test your sub classes, or doing something with the output (e.g. in a OH_fixup() when the page content ...

  $captured_output = $webapp->capture('process');
  if ( $$captured_output =~ /something to test/ ){
      print 'ÍT WORKS!'



( run in 2.186 seconds using v1.01-cache-2.11-cpan-5dc5da66d9d )