blockName = $blockName; } /** * Throws an exception when parent block calls corrupted child block method * * @param string $method * @param array $args * @return void * @throws LocalizedException */ public function __call($method, $args) { throw new LocalizedException( new Phrase('Block %1 throws exception and cannot be rendered.', [$this->blockName]) ); } /** * Declared in BlockInterface and also throws an exception * * @throws LocalizedException * @return void */ public function toHtml() { throw new LocalizedException( new Phrase('Block %1 throws exception and cannot be rendered.', [$this->blockName]) ); } }