Catalyst-Helper-View-TTSimple

 view release on metacpan or  search on metacpan

lib/Catalyst/Helper/View/TTSimple.pm  view on Meta::CPAN

See L<[% app %]>

=head1 DESCRIPTION

Catalyst TTSimple View.

=head1 AUTHOR

[% author %]

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;

__config_main__
[% USE Date;
   year = Date.format(Date.now, '%Y');
-%]
[% TAGS star -%]
[% # config/main
   #
   # This is the main configuration template which is processed before
   # any other page, by virtue of it being defined as a PRE_PROCESS 
   # template.  This is the place to define any extra template variables,
   # macros, load plugins, and perform any other template setup.

   IF Catalyst.debug;
     # define a debug() macro directed to Catalyst's log
     MACRO debug(message) CALL Catalyst.log.debug(message);
   END;

   # define a data structure to hold sitewide data
   site = {
     title     => 'Catalyst::View::TTSimple Example Page',
     copyright => '[* year *] Your Name Here',
   };

-%]

__site_wrapper__
[% TAGS star -%]
[% IF template.name.match('\.(css|js|txt)');
     debug("Passing page through as text: $template.name");
     content;
   ELSE;
     debug("Applying HTML page layout wrappers to $template.name\n");
     content WRAPPER site/layout;
   END;
-%]

__site_layout__
[% USE Date;
   year = Date.format(Date.now, '%Y');
-%]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Language" content="en-us" />
		
		<meta name="ROBOTS" content="ALL" />
		<meta http-equiv="imagetoolbar" content="no" />
		<meta name="MSSmartTagsPreventParsing" content="true" />
		<meta name="Copyright" content="(c) [% year %] Copyright content:  Copyright design: your name" />
		<!-- (c) Copyright [% year %] by your name All Rights Reserved. -->
		
		<meta name="Keywords" content="__KEYWORDS__" />
		<meta name="Description" content="__DESCRIPTION__" />
		
		[% TAGS star -%]
		<title>[% site.title %]</title>
		
		<link href="/static/stylesheets/master.css" rel="stylesheet" type="text/css" media="all" />
		
		<!-- import the DOM logic from external javascript files -->
		<script type="text/javascript" src="/static/javascripts/application.js"></script>		
	</head>
	
	<body>
[% content %]
	</body>
</html>

__index.tt2__
<p>Welcome to your Simple TT View!</p>



( run in 2.559 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )