Add 'how it work'

This commit is contained in:
bzick
2013-08-22 00:03:20 +04:00
parent 25975a6782
commit cb803f5d9c
6 changed files with 60 additions and 20 deletions

View File

@@ -9,6 +9,7 @@
*/
namespace Fenom;
use Fenom;
use Symfony\Component\Yaml\Exception\RuntimeException;
/**
* Primitive template
@@ -69,6 +70,11 @@ class Render extends \ArrayObject
*/
protected $_provider;
/**
* @var \Closure[]
*/
protected $_macros;
/**
* @param Fenom $fenom
* @param callable $code template body
@@ -192,6 +198,10 @@ class Render extends \ArrayObject
*/
public function getMacro($name)
{
if(empty($this->_macros[$name])) {
var_dump($this->_macros[$name]); exit;
throw new RuntimeException('macro not found');
}
return $this->_macros[$name];
}