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('The "%1" block threw an exception, and it can\'t be rendered.', [$this->blockName]) ); } /** * Declared in BlockInterface and also throws an exception * * @throws LocalizedException * @return void */ public function toHtml() { throw new LocalizedException( new Phrase('The "%1" block threw an exception, and it can\'t be rendered.', [$this->blockName]) ); } }