|
@@ -261,9 +261,8 @@ class FormExtension extends \Twig_Extension
|
|
$resource = $this->environment->loadTemplate($resource);
|
|
$resource = $this->environment->loadTemplate($resource);
|
|
}
|
|
}
|
|
|
|
|
|
- // an array of blockName => template
|
|
|
|
$blocks = array();
|
|
$blocks = array();
|
|
- foreach ($resource->getBlockNames() as $name) {
|
|
|
|
|
|
+ foreach ($this->getBlockNames($resource) as $name) {
|
|
$blocks[$name] = $resource;
|
|
$blocks[$name] = $resource;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -273,6 +272,17 @@ class FormExtension extends \Twig_Extension
|
|
return $templates;
|
|
return $templates;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ protected function getBlockNames($resource)
|
|
|
|
+ {
|
|
|
|
+ $names = $resource->getBlockNames();
|
|
|
|
+ $parent = $resource;
|
|
|
|
+ while (false !== $parent = $parent->getParent(array())) {
|
|
|
|
+ $names = array_merge($names, $parent->getBlockNames());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return array_unique($names);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Returns the name of the extension.
|
|
* Returns the name of the extension.
|
|
*
|
|
*
|