[Catalyst-dev] RFC: Catalyst::View::Mason::Templated

Dave Rolsky autarch at urth.org
Tue Sep 18 14:46:40 GMT 2007


On Tue, 18 Sep 2007, Sebastian Willert wrote:

> I found myself in a Catalyst coding spree lately (or rather in a
> packaging spree for quite old code) so I present my second request for
> comments tonight. I use HTML::Mason extensively for most of my projects
> and was not really satisfied with the amount of features accessible
> through Catalyst::View::Mason so I whipped up my own some time ago.

I really don't think we need two Catalyst views for Mason. If the 
Templated base class is "the new thing", that's fine, but there's no need 
for two views.

> MASON CONFIGURATION
>  This allows you to to pass additional settings to the
>  HTML::Mason::Interp constructor or to set the options as below:
>
>  "DATA_DIR"
>    Defaults to "File::Spec->tmpdir"
>
>  "ALLOW_GLOBALS"
>    Defaults to "qw/$c $name $base/"
>
>    If you add additional allowed globals those will be prepended to the
>    list of default globals.
>
>  Most of the parameters listet in HTML::Mason::Params are also present
>  (preverably in uppercase), so you can e.g. use your custom request
>  class.

Why uppercase? This is just going to make things a little confusing for 
people already familiar with the parameters Mason accepts.

It might make sense to use upper case for parameters that the view is 
consuming instead of passing on to Mason, however.

>       = { INCLUDE_PATH  =>
>         [ '/usr/local/foo', '/usr/local/foo/widgets',
>           '/usr/local/bar', '/usr/local/bar/widgets' ],
>         };
>
>    gets transformed to:
>
>       MyApp->config->{View::Mason}
>       = { INCLUDE_PATH  =>
>         [ [ MAIN => '/usr/local/foo' ],
>           [ FOO_WIDGETS => '/usr/local/foo/widgets' ],
>           [ BAR => '/usr/local/bar' ],
>           [ BAR_WIDGETS => '/usr/local/bar/widgets' ] ],
>         };

Is this really necessary. Mason already supports a comp_path parameter 
that does this, as you obviously know. What is gained by renaming this?

The ability to give a list of unnamed roots is worthwhile, but maybe you 
could submit a patch for Mason to do this?


/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/



More information about the Catalyst-dev mailing list