]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - lib/CGI/Ex/App.pod
CGI::Ex 2.14
[chaz/p5-CGI-Ex] / lib / CGI / Ex / App.pod
index a359a4754495020a20133f0e20375e0e4addde33..0188cdc40e6c0d38d508384a491d956f05fd4094 100644 (file)
@@ -516,15 +516,19 @@ The following shows how to add variables using the hash_swap hook on the step "m
         };
     }
 
-You could also return the fields from the hash_common hook and they would be available
-in both the template swapping as well as form filling.
+You could also return the fields from the hash_common hook and they
+would be available in both the template swapping as well as form
+filling.
 
-See the hash_base, hash_common, hash_form, hash_swap, hash_errors, swap_template, and
-template_args hooks for more information.
+See the hash_base, hash_common, hash_form, hash_swap, hash_errors,
+swap_template, and template_args hooks for more information.
 
-The default template engine used is CGI::Ex::Template which is Template::Toolkit compatible.
-See the CGI::Ex::Template or Template::Toolkit documentation for the types of data
-that can be passed, and for the syntax that can be used.
+The default template engine used is CGI::Ex::Template which is now a subclass
+of Template::Alloy.  The default interface used is TT which is the
+Template::Toolkit interface.  Template::Alloy allows for using TT documents,
+HTML::Template documents, HTML::Template::Expr documents, Text::Tmpl documents,
+or Velocity (VTL) documents.  See the L<Template::Alloy> documentation
+for more information.
 
 =head1 ADDING ADDITIONAL FORM FILL VARIABLES
 
@@ -561,7 +565,7 @@ validation files).
 The default file_print hook will look for content on your file system,
 but it can also be completely overridden to return a reference to a
 scalar containing the contents of your file.  Actually it can return
-anything that CGI::Ex::Template (Template::Toolkit compatible) will
+anything that Template::Alloy (Template::Toolkit compatible) will
 treat as input.  This templated html is displayed to the user during
 any step that enters the "print" phase.
 
@@ -784,7 +788,7 @@ Note: This example would be considerably shorter if the html file
 separate files.  Though CGI::Ex::App will work "out of the box" as
 shown it is more probable that any platform using it will customize
 the various hooks to their own tastes (for example, switching print to
-use a templating system other than CGI::Ex::Template).
+use a templating system other than Template::Alloy).
 
 =head1 SYNOPSIS STEP BY STEP
 
@@ -1283,7 +1287,7 @@ hook.  Adds method base_dir_rel to hook name_module, and name_step and
 adds on the default file extension found in $self->ext_print which
 defaults to the property $self->{ext_print} which will default to
 ".html".  Should return a filename relative to base_dir_abs that can be
-swapped using CGI::Ex::Template, or should be a scalar reference to
+swapped using Template::Alloy, or should be a scalar reference to
 the template content that can be swapped.  This will be used by the
 hook print.
 
@@ -1959,11 +1963,12 @@ List the step previous to this one.  Will return '' if there is no previous step
 
 =item print (hook)
 
-Take the information generated by prepared_print, format it, and print it out.
-Default incarnation uses CGI::Ex::Template which is compatible with
-Template::Toolkit.  Arguments are: step name (used to call the
-file_print hook), swap hashref (passed to call swap_template), and
-fill hashref (passed to fill_template).
+Take the information generated by prepared_print, format it, and print
+it out.  Default incarnation uses CGI::Ex::Template (a subclass of
+Template::Alloy) which is compatible with Template::Toolkit.
+Arguments are: step name (used to call the file_print hook), swap
+hashref (passed to call swap_template), and fill hashref (passed to
+fill_template).
 
 During the print call, the file_print hook is called which should
 return a filename or a scalar reference to the template content is
@@ -2144,19 +2149,23 @@ method to look for in the form.  Default value is 'step'.
 
 =item swap_template (hook)
 
-Takes the template and hash of variables prepared in print, and processes them
-through the current template engine (default engine is CGI::Ex::Template).
+Takes the template and hash of variables prepared in print, and
+processes them through the current template engine (default engine is
+CGI::Ex::Template a subclass of Template::Alloy).
 
-Arguments are the template and the swap hashref.  The template can be either a
-scalar reference to the actual content, or the filename of the content.  If the
-filename is specified - it should be relative to base_dir_abs (which will be
-used to initialize INCLUDE_PATH by default).
+Arguments are the template and the swap hashref.  The template can be
+either a scalar reference to the actual content, or the filename of
+the content.  If the filename is specified - it should be relative to
+base_dir_abs (which will be used to initialize INCLUDE_PATH by
+default).
 
-The default method will create a template object by calling the template_args hook
-and passing the returned hashref to the template_obj method.  The default template_obj method
-returns a CGI::Ex::Template object, but could easily be swapped to use a Template::Toolkit
-based object.  If a non-Template::Toolkit compatible object is to be used, then
-the swap_template hook can be overridden to use another templating engine.
+The default method will create a template object by calling the
+template_args hook and passing the returned hashref to the
+template_obj method.  The default template_obj method returns a
+CGI::Ex::Template object, but could easily be swapped to use a
+Template::Toolkit based object.  If a non-Template::Toolkit compatible
+object is to be used, then the swap_template hook can be overridden to
+use another templating engine.
 
 For example to use the HTML::Template engine you could override the swap_template
 method as follows:
@@ -2189,6 +2198,8 @@ following to parse the templates using HTML::Template::Expr syntax.
         return {SYNTAX => 'hte'};
     }
 
+For a listing of the available syntaxes, see the current L<Template::Alloy> documentation.
+
 =item template_args (hook)
 
 Returns a hashref of args that will be passed to the "new" method of CGI::Ex::Template.
@@ -2196,7 +2207,8 @@ The method is normally called from the swap_template hook.  The swap_template ho
 will add a value for INCLUDE_PATH which is set equal to base_dir_abs, if the INCLUDE_PATH
 value is not already set.
 
-The returned hashref can contain any arguments that CGI::Ex::Template would understand.
+The returned hashref can contain any arguments that CGI::Ex::Template (a subclass of Template::Alloy)
+would understand.
 
     sub template_args {
         return {
@@ -2205,11 +2217,15 @@ The returned hashref can contain any arguments that CGI::Ex::Template would unde
         };
     }
 
+See the L<Template::Alloy> documentation for a listing of all possible configuration arguments.
+
 =item template_obj (method)
 
-Called from swap_template.  It is passed the result of template_args that have
-had a default INCLUDE_PATH added.  The default implementation uses CGI::Ex::Template
-but can easily be changed to use Template::Toolkit by using code similar to the following:
+Called from swap_template.  It is passed the result of template_args
+that have had a default INCLUDE_PATH added.  The default
+implementation uses CGI::Ex::Template (a subclass of Template::Alloy)
+but can easily be changed to use Template::Toolkit by using code
+similar to the following:
 
     use Template;
 
@@ -2371,7 +2387,8 @@ different.
 Seemingly the most well know of application builders.
 CGI::Ex::App is different in that it:
 
-  * Uses Template::Toolkit compatible CGI::Ex::Template by default
+  * Uses Template::Toolkit compatible CGI::Ex::Template (a
+      subclass of Template::Alloy) by default.
       CGI::Ex::App can easily use another toolkit by simply
       overriding the ->swap_template method.
       CGI::Application uses HTML::Template.
This page took 0.024242 seconds and 4 git commands to generate.