/** * Builds the block * * @param string $id */ protected function buildBlock($id) { $blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true); $options = $this->rawLayout->getProperty($id, RawLayout::OPTIONS, true); $types = $this->typeHelper->getTypes($blockType); // resolve options $resolvedOptions = $this->optionsResolver->resolveOptions($blockType, $options); $this->rawLayout->setProperty($id, RawLayout::RESOLVED_OPTIONS, $resolvedOptions); // point the block builder state to the current block $this->blockBuilder->initialize($id); // iterate from parent to current foreach ($types as $type) { $type->buildBlock($this->blockBuilder, $resolvedOptions); $this->registry->buildBlock($type->getName(), $this->blockBuilder, $resolvedOptions); } }