if ($varInit) { unset($this->variableStack
[$viewCacheKey]);
} return $html;
} public function searchAndRenderBlock(FormView
$view, string
$blockNameSuffix, array
$variables =
[]): string
{ $renderOnlyOnce = 'row' ===
$blockNameSuffix || 'widget' ===
$blockNameSuffix;
if ($renderOnlyOnce &&
$view->
isRendered()) { // This is not allowed, because it would result in rendering same IDs multiple times, which is not valid.
throw new BadMethodCallException(sprintf('Field "%s" has already been rendered, save the result of previous render call to a variable and output that instead.',
$view->vars
['name'
]));
} // The cache key for storing the variables and types
$viewCacheKey =
$view->vars
[self::CACHE_KEY_VAR
];
$viewAndSuffixCacheKey =
$viewCacheKey.
$blockNameSuffix;
// In templates, we have to deal with two kinds of block hierarchies:
//
// +---------+ +---------+