/**
* Renders template.
* @return Template
* @internal
*/
protected function createTemplate($name, array $params, $referenceType)
{
$name = $this->engine->getLoader()->getReferredName($name, $this->name);
$child = $this->engine->createTemplate($name, $params);
$child->referringTemplate = $this;
$child->referenceType = $referenceType;
$child->global = $this->global;
if (in_array($referenceType, ['extends', 'includeblock', 'import'])) {
$this->blockQueue = array_merge_recursive($this->blockQueue, $child->blockQueue);
foreach ($child->blockTypes as $nm => $type) {
$this->checkBlockContentType($type, $nm);
}
$child->blockQueue =& $this->blockQueue;
$child->blockTypes =& $this->blockTypes;
}
return $child;
}