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:[email protected]]
> Sent: 21 September 2010 18:05
> To: The elegant MVC web framework; [email protected]
> Subject: Re: [Catalyst] Make the money format macro globally available.
>
> Hi Duncan -
>
> On Tue, 21 Sep 2010 17:52 +0100, "Duncan Garland"
> <[email protected]> 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: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/[email protected]/
> 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.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to