home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / View.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-30  |  3.2 KB  |  128 lines

  1. #============================================================= -*-Perl-*-
  2. #
  3. # Template::Plugin::View
  4. #
  5. # DESCRIPTION
  6. #   A user-definable view based on templates.  Similar to the concept of
  7. #   a "Skin".
  8. #
  9. # AUTHOR
  10. #   Andy Wardley   <abw@kfs.org>
  11. #
  12. # COPYRIGHT
  13. #   Copyright (C) 2000 Andy Wardley.  All Rights Reserved.
  14. #
  15. #   This module is free software; you can redistribute it and/or
  16. #   modify it under the same terms as Perl itself.
  17. #
  18. # REVISION
  19. #   $Id: View.pm,v 2.63 2004/01/13 16:20:39 abw Exp $
  20. #
  21. #============================================================================
  22.  
  23. package Template::Plugin::View;
  24.  
  25. require 5.004;
  26.  
  27. use strict;
  28. use Template::Plugin;
  29. use vars qw( $VERSION );
  30. use base qw( Template::Plugin );
  31.  
  32. $VERSION = sprintf("%d.%02d", q$Revision: 2.63 $ =~ /(\d+)\.(\d+)/);
  33.  
  34. use Template::View;
  35.  
  36. #------------------------------------------------------------------------
  37. # new($context, \%config)
  38. #------------------------------------------------------------------------
  39.  
  40. sub new {
  41.     my $class = shift;
  42.     my $context = shift;
  43.     my $view = Template::View->new($context, @_)
  44.     || return $class->error($Template::View::ERROR);
  45.     $view->seal();
  46.     return $view;
  47. }
  48.  
  49.  
  50.  
  51. 1;
  52.  
  53. __END__
  54.  
  55.  
  56. #------------------------------------------------------------------------
  57. # IMPORTANT NOTE
  58. #   This documentation is generated automatically from source
  59. #   templates.  Any changes you make here may be lost.
  60. #   The 'docsrc' documentation source bundle is available for download
  61. #   from http://www.template-toolkit.org/docs.html and contains all
  62. #   the source templates, XML files, scripts, etc., from which the
  63. #   documentation for the Template Toolkit is built.
  64. #------------------------------------------------------------------------
  65.  
  66. =head1 NAME
  67.  
  68. Template::Plugin::View - Plugin to create views (Template::View)
  69.  
  70. =head1 SYNOPSIS
  71.  
  72.     [% USE view(
  73.         prefix = 'splash/'        # template prefix/suffix
  74.         suffix = '.tt2'        
  75.         bgcol  = '#ffffff'        # and any other variables you 
  76.         style  = 'Fancy HTML'       # care to define as view metadata,
  77.         items  = [ foo, bar.baz ]    # including complex data and
  78.         foo    = bar ? baz : x.y.z  # expressions
  79.     %]
  80.  
  81.     [% view.title %]            # access view metadata
  82.  
  83.     [% view.header(title = 'Foo!') %]    # view "methods" process blocks or
  84.     [% view.footer %]            # templates with prefix/suffix added
  85.  
  86. =head1 DESCRIPTION
  87.  
  88. This plugin module creates Template::View objects.  Views are an
  89. experimental feature and are subject to change in the near future.
  90. In the mean time, please consult L<Template::View> for further info.
  91.  
  92. =head1 AUTHOR
  93.  
  94. Andy Wardley E<lt>abw@andywardley.comE<gt>
  95.  
  96. L<http://www.andywardley.com/|http://www.andywardley.com/>
  97.  
  98.  
  99.  
  100.  
  101. =head1 VERSION
  102.  
  103. 2.63, distributed as part of the
  104. Template Toolkit version 2.13, released on 30 January 2004.
  105.  
  106. =head1 COPYRIGHT
  107.  
  108.   Copyright (C) 1996-2004 Andy Wardley.  All Rights Reserved.
  109.   Copyright (C) 1998-2002 Canon Research Centre Europe Ltd.
  110.  
  111. This module is free software; you can redistribute it and/or
  112. modify it under the same terms as Perl itself.
  113.  
  114. =head1 SEE ALSO
  115.  
  116. L<Template::Plugin|Template::Plugin>, L<Template::View|Template::View>
  117.  
  118. =cut
  119.  
  120. # Local Variables:
  121. # mode: perl
  122. # perl-indent-level: 4
  123. # indent-tabs-mode: nil
  124. # End:
  125. #
  126. # vim: expandtab shiftwidth=4:
  127.