Filewatcher File Search File Search
Content Search
» » » » » » perl-Catalyst-View-Mason-0.18-6.fc16.noarch.rpm » Content »
pkg://perl-Catalyst-View-Mason-0.18-6.fc16.noarch.rpm:17340/usr/share/doc/perl-Catalyst-View-Mason-0.18/  info  HEADER  downloads

perl-Catalyst-View-Mason - Mason View Class…  more info»


    Catalyst::View::Mason - Mason View Class

        # use the helper
        script/ view Mason Mason

        # lib/MyApp/View/
        package MyApp::View::Mason;

        use base 'Catalyst::View::Mason';

        __PACKAGE__->config(use_match => 0);



    Want to use a Mason component in your views? No problem!
    Catalyst::View::Mason comes to the rescue.

    From the Catalyst controller:

        $c->stash->{name} = 'Homer'; # Pass a scalar
        $c->stash->{extra_info} = {
                   last_name => 'Simpson',
                   children => [qw(Bart Lisa Maggie)]
        }; # A ref works too

    From the Mason template:

        <p>Your name is <strong><% $name %> <% $extra_info->{last_name} %></strong>
        <p>Your children are:
        % foreach my $child (@{$extra_info->{children}}) {
        <li><% $child %></li>
        % }

  new($app, \%config)
    Returns the component path from $c->stash->{template} or
    $c->request->match or $c->action (depending on the use_match setting).

    Renders the component specified in $c->stash->{template} or
    $c->request->match or $c->action (depending on the use_match setting) to

    Note that the component name must be absolute, or is converted to
    absolute (i.e., a / is added to the beginning if it doesn't start with

    Mason global variables $base, $c, and $name are automatically set to the
    base, context, and name of the app, respectively.

  render($c, $component_path, \%args)
    Renders the given template and returns output, or a
    HTML::Mason::Exception object upon error.

    The template variables are set to %$args if $args is a hashref, or
    $c->stash otherwise.

    This allows you to to pass additional settings to the
    HTML::Mason::Interp constructor or to set the options as below:

        This string is appended (if present) to "$c->action" when generating
        a template path.

        Defaults to an empty string.

        Example: "template_extension => '.html'"

        Set this to a true value if you want "template_extension" to be
        appended to the component path even if it was explicitly set.

        Defaults to 0.

        Example: "always_append_template_extension => 1"

        Use "$c->request->match" instead of "$c->action" to determine which
        template to use if "$c->stash->{template}" isn't set. This option is
        deprecated and exists for backward compatibility only.

        Currently defaults to 0. Old code should set this to 1 to avoid

        Example: "use_match => 0"

    The default HTML::Mason::Interp config options are as follows:


        "File::Spec->catdir( File::Spec->tmpdir,
        sprintf('%s_%d_mason_data_dir', $app, $<) )"

        "qw/$c $name $base/"

        If you add additional allowed globals those will be appended to the
        list of default globals.

    Catalyst, HTML::Mason, "Using Mason from a Standalone Script" in

    Andres Kievsky ""
    Sebastian Riedel ""
    Marcus Ramberg
    Florian Ragwitz ""
    Justin Hunter ""

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

Results 1 - 1 of 1
Help - FTP Sites List - Software Dir.
Search over 15 billion files
© 1997-2017