blob: 6073ee8141b26b7f551f689b1e9d33c55ad0b476 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
package FixMyStreet::App::View::Email;
use base 'Catalyst::View::TT';
use strict;
use warnings;
use mySociety::Locale;
use FixMyStreet;
__PACKAGE__->config(
TEMPLATE_EXTENSION => '.txt',
INCLUDE_PATH => [ #
FixMyStreet->path_to( 'templates', 'email', 'default' ),
],
ENCODING => 'utf8',
render_die => 1,
expose_methods => ['loc', 'file_exists'],
);
=head1 NAME
FixMyStreet::App::View::Email - TT View for FixMyStreet::App
=head1 DESCRIPTION
TT View for FixMyStreet::App.
=cut
=head2 loc
[% loc('Some text to localize') %]
Passes the text to the localisation engine for translations.
=cut
sub loc {
my ( $self, $c, @args ) = @_;
return _(@args);
}
sub file_exists {
my ( $self, $c, @args ) = @_;
-e FixMyStreet->path_to(@args);
}
1;
|