objectManager = $objectManager; } /** * Get method * * @param string $type * @return RenderInterface * @throws \InvalidArgumentException */ public function get($type) { $className = 'Magento\\Framework\\View\\Render\\' . ucfirst($type); $model = $this->objectManager->get($className); if (!$model instanceof RenderInterface) { throw new \InvalidArgumentException( 'Type "' . $type . '" is not instance on Magento\Framework\View\RenderInterface' ); } return $model; } }