From 05578c8860ad109f13aba5337977e27f32c1a569 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Sep 2010 10:10:16 +0200 Subject: [PATCH] added Twig_Template::hasBlock() method --- lib/Twig/Template.php | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index b4b4b92..bbbee48 100644 --- 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)); -- 1.7.2.5