diff --git a/src/Compiler.php b/src/Compiler.php index 0be81c6..b977b66 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -57,7 +57,15 @@ function __construct($cacheDir = null, array $paths = []) ); } - function compile($path, $data = []) + function extend($name, callable $handler) { + $this->directive($name, $handler); + } + + function directive($name, callable $handler) { + $this->compiler->directive($name, $handler); + } + + function compile($path, array $data = []) { // If the file can't be found it's probably supplied as a template within // one of the base directories @@ -78,7 +86,7 @@ function compile($path, $data = []) ); } - function render($path, $data = []) + function render($path, array $data = []) { return $this->compile($path, $data)->render(); }