[Catalyst] Make the money format macro globally available.

Alexander Hartmaier alexander.hartmaier at t-systems.at
Wed Sep 29 22:19:43 GMT 2010


Or use the awesome expose_methods config param introduced in version
0.35:
http://search.cpan.org/~bobtfish/Catalyst-View-TT-0.35/lib/Catalyst/View/TT.pm#expose_methods

--
Best regards, Alex


Am Mittwoch, den 22.09.2010, 12:47 +0200 schrieb Duncan Garland:
> Works like a charm. Thanks.
>
> -----Original Message-----
> From: Larry Leszczynski [mailto:larryl at emailplus.org]
> Sent: 21 September 2010 18:05
> To: The elegant MVC web framework; catalyst at lists.scsys.co.uk
> Subject: Re: [Catalyst] Make the money format macro globally available.
>
> Hi Duncan -
>
> On Tue, 21 Sep 2010 17:52 +0100, "Duncan Garland"
> <Duncan.Garland at motortrak.com> wrote:
> > How do you make the money macro available in all templates?
> >
> > [% USE money=format('%.2f') -%]
> >
> > Presumably something goes in here:
> >
> > __PACKAGE__->config(
> >     TEMPLATE_EXTENSION => '.tt',
> >     render_die => 1,
> >     WRAPPER => 'wrapper.tt',
> > );
>
> You can put commonly used macros, formats, etc. in a file named e.g.
> "pre_process_config.tt" in your main templates directory, then add
> "PRE_PROCESS" to your config:
>
>
>   __PACKAGE__->config(
>       TEMPLATE_EXTENSION => '.tt',
>       render_die => 1,
>       WRAPPER => 'wrapper.tt',
>       PRE_PROCESS => 'pre_process_config.tt'.
>   );
>
>
> HTH,
> Larry
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*



More information about the Catalyst mailing list