/** * Create Ui Component instance * * @param string $componentName * @param string $handleName * @param array $arguments * @return UiComponentInterface */ public function createUiComponent($componentName, $handleName, array $arguments = []) { if (!$this->layout) { $this->renderContext->setNamespace($handleName); $this->layout = $this->layoutFactory->create(); $this->renderContext->setLayout($this->layout); $this->layout->getUpdate()->addHandle('ui_components'); $this->layout->getUpdate()->addHandle($handleName); $this->loadLayout(); $this->layoutLoaded = true; } $view = $this->getUiElementView($componentName); $view->update($arguments); if ($this->layoutLoaded) { $this->prepare($view); } return $view; }