mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Add 'how it work'
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user