This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/Rails/ActionMailer/Template.php

32 lines
714 B
PHP
Raw Normal View History

2013-10-02 08:12:58 +02:00
<?php
namespace Rails\ActionMailer;
class Template extends \Rails\ActionView\Base
{
private
$_template_file,
$_contents;
public function __construct($template_file)
{
if (!is_file($template_file)) {
throw new Exception\RuntimeException(
sprintf("Template file %s doesn't exist", $template_file)
);
}
$this->_template_file = $template_file;
}
public function renderContent()
{
ob_start();
require $this->_template_file;
$this->_contents = ob_get_clean();
return $this->_contents;
}
public function contents()
{
return $this->_contents;
}
}