\Greg\View\CompilerStrategy is a strategy of custom compilers.
Example:
class FooCompiler implements \Greg\View\CompilerStrategy
{
public function getCompiledFile($file)
{
// @todo return compiled file from the template file.
}
public function getCompiledFileFromString($id, $string)
{
// @todo return compiled file from the template string.
}
public function removeCompiledFiles()
{
// @todo remove all compiled files.
}
}- getCompiledFile - Get compiled file from a template file;
- getCompiledFileFromString - Get compiled file from a template string;
- removeCompiledFiles - Remove all compiled files.
Get compiled file from a template file.
getCompiledFile(string $file): string$file - Template file.
Get compiled file from a template string.
getCompiledFileFromString(string $id, string $string): string$id - Template unique id.
$string - Template string.
Remove all compiled files.
removeCompiledFiles(): $this