Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 1.26 KB

CompilerStrategy.md

File metadata and controls

64 lines (44 loc) · 1.26 KB

Compiler Strategy Documentation

\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.
    }
}

Table of contents:

Methods:

getCompiledFile

Get compiled file from a template file.

getCompiledFile(string $file): string

$file - Template file.

getCompiledFileFromString

Get compiled file from a template string.

getCompiledFileFromString(string $id, string $string): string

$id - Template unique id.
$string - Template string.

removeCompiledFiles

Remove all compiled files.

removeCompiledFiles(): $this