Guest User

Untitled

a guest
Jun 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. sub render_file {
  2. my ( $self, $file, $path, $vars ) = @_;
  3. $vars ||= {};
  4. my $t = Template->new;
  5. my $template = $self->get_sharedir_file( 'root', $file );
  6. return 0 unless $template;
  7. my $output;
  8. $t->process( \$template, { %{$self}, %$vars }, \$output )
  9. || Catalyst::Exception->throw(
  10. message => qq/Couldn't process "$file", / . $t->error() );
  11. $self->mk_file( $path, $output );
  12. }
Add Comment
Please, Sign In to add comment