GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CATALYST::HELPER::VIEW::TTSITE (3)

.ds Aq ’

NAME

Catalyst::Helper::View::TTSite - Helper for TT view which builds a skeleton web site

CONTENTS

SYNOPSIS

# use the helper to create the view module and templates



    $ script/myapp_create.pl view HTML TTSite



# add something like the following to your main application module



    sub message : Global {
        my ( $self, $c ) = @_;
        $c->stash->{template} = message.tt2;
        $c->stash->{message}  ||= $c->req->param(message) || No message;
    }

    sub default : Private {
        my ( $self, $c ) = @_;
        $c->stash->{template} = welcome.tt2;
    }

    sub end : Private { # Or use Catalyst::Action::RenderView
        my ( $self, $c ) = @_;
        $c->forward( $c->view(HTML) );
    }



DESCRIPTION

This helper module creates a TT View module. It goes further than Catalyst::Helper::View::TT in that it additionally creates a simple set of templates to get you started with your web site presentation.

It creates the templates in root/ directory underneath your main project directory. In here two further subdirectories are created: root/src which contains the main page templates, and root/lib containing a library of other template components (header, footer, etc.) that the page templates use.

The view module that the helper creates is automatically configured to locate these templates.

    Default Rendering

To render a template the following process is applied:

The configuration template root/lib/config/main is rendered. This is controlled by the PRE_PROCESS configuration variable set in the controller generated by Catalyst::Helper::View::TTsite. Additionally, templates referenced by the PROCESS directive will then be rendered. By default the following additional templates are set: root/lib/config/col, which defines color names and RGB their RGB values and /root/lib/config/url, which defines site wide variables available to templates.

Next, the template defined by the WRAPPER config variable is called. The default wrapper template is located in root/lib/site/wrapper. The wrapper template passes files with .css/.js/.txt extensions through as text OR processes the templates defined after the WRAPPER directive: site/html and site/layout.

Based on the default value of the WRAPPER directive in root/lib/site/wrapper, the following templates are processed in order:
o root/src/your_template.tt2
o root/lib/site/footer
o root/lib/site/header
o root/lib/site/layout
o root/lib/site/html
Finally, the rendered content is returned to the browser.

METHODS

    mk_compclass

Generates the component class.

    mk_templates

Generates the templates.

SEE ALSO

Catalyst, Catalyst::View::TT, Catalyst::Helper, Catalyst::Helper::View::TT

AUTHOR

Andy Wardley <abw@cpan.org>

LICENSE

This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.

NAME

[% class %] - Catalyst TTSite View

SYNOPSIS

See [% app %]

DESCRIPTION

Catalyst TTSite View.

AUTHOR

[% author %]

LICENSE

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CATALYST::HELPER::VIEW::TTSITE (3) 2015-10-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.