public function Text_Template::renderTo

Renders the template and writes the result to a file.

Parameters

string $target:

File

drupal/core/vendor/phpunit/php-text-template/Text/Template.php, line 142

Class

Text_Template
A simple template engine.

Code

public function renderTo($target) {
  $fp = @fopen($target, 'wt');
  if ($fp) {
    fwrite($fp, $this
      ->render());
    fclose($fp);
  }
  else {
    $error = error_get_last();
    throw new RuntimeException(sprintf('Could not write to %s: %s', $target, substr($error['message'], strpos($error['message'], ':') + 2)));
  }
}