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:
<?php
/**
* @author stev leibelt <artodeto@bazzline.net>
* @since 2015-10-09
*/
namespace Net\Bazzline\Component\Template;
class TemplateDumper
{
/**
* @param TemplateInterface $template
* @param string $filePath
* @return bool
*/
public function __invoke(TemplateInterface $template, $filePath)
{
return $this->dump($template, $filePath);
}
/**
* @param TemplateInterface $template
* @param string $filePath
* @return bool
*/
public function dump(TemplateInterface $template, $filePath)
{
$wasSuccessful = (file_put_contents($filePath, $template->render()) !== false);
return $wasSuccessful;
}
}