projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
1230c21
)
added Twig_Template::hasBlock() method
author
Fabien Potencier
<fabien.potencier@gmail.com>
Thu, 30 Sep 2010 08:10:16 +0000 (10:10 +0200)
committer
Fabien Potencier
<fabien.potencier@gmail.com>
Thu, 30 Sep 2010 08:10:16 +0000 (10:10 +0200)
lib/Twig/Template.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Template.php
b/lib/Twig/Template.php
index
b4b4b92
..
bbbee48
100644
(file)
--- a/
lib/Twig/Template.php
+++ b/
lib/Twig/Template.php
@@
-36,11
+36,16
@@
abstract class Twig_Template implements Twig_TemplateInterface
return $this->env;
}
- protected function getBlock($name, array $context)
+ public function getBlock($name, array $context)
{
return call_user_func($this->blocks[$name][0], $context, array_slice($this->blocks[$name], 1));
}
+ public function hasBlock($name)
+ {
+ return isset($this->blocks[$name][0]);
+ }
+
protected function getParent($context, $parents)
{
return call_user_func($parents[0], $context, array_slice($parents, 1));