/** * Prepare component configuration * * @return void */ public function prepare() { parent::prepare(); $dataType = $this->getData('config/dataType'); $wrappedComponentConfig = []; if ($dataType) { $this->wrappedComponent = $this->uiComponentFactory->create($this->getName(), $dataType, array_merge(['context' => $this->getContext()], (array) $this->getData())); $this->wrappedComponent->prepare(); $wrappedComponentConfig = $this->getConfiguration($this->wrappedComponent); } $this->applySorting(); $jsConfig = array_replace_recursive($wrappedComponentConfig, $this->getConfiguration($this)); $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig); }
/** * Prepare component configuration * * @return void */ public function prepare() { $dataType = $this->getData('config/dataType'); if ($dataType) { $this->wrappedComponent = $this->uiComponentFactory->create($this->getName(), $dataType, array_merge(['context' => $this->getContext()], (array) $this->getData())); $this->wrappedComponent->prepare(); $wrappedComponentConfig = $this->getJsConfig($this->wrappedComponent); // Merge JS configuration with wrapped component configuration $jsConfig = array_replace_recursive($wrappedComponentConfig, $this->getJsConfig($this)); $this->setData('js_config', $jsConfig); $this->setData('config', array_replace_recursive((array) $this->wrappedComponent->getData('config'), (array) $this->getData('config'))); } $this->applySorting(); parent::prepare(); }
/** * Prepare component configuration * * @return void * @throws \Magento\Framework\Exception\LocalizedException */ public function prepare() { parent::prepare(); $formElement = $this->getData('config/formElement'); if (null === $formElement) { throw new LocalizedException(__('The configuration parameter "formElement" is a required for "' . $this->getName() . '" field.')); } // Create of wrapped component $this->wrappedComponent = $this->uiComponentFactory->create($this->getName(), $formElement, array_merge(['context' => $this->getContext()], (array) $this->getData())); $this->wrappedComponent->prepare(); // To prepare the component configuration $wrappedComponentConfig = $this->getConfiguration($this->wrappedComponent); $jsConfig = array_replace_recursive($wrappedComponentConfig, $this->getConfiguration($this, $this->wrappedComponent->getComponentName())); $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig); }
/** * Call prepare method in the component UI * * @param UiComponentInterface $component * @return void */ protected function prepareComponent(UiComponentInterface $component) { foreach ($component->getChildComponents() as $child) { $this->prepareComponent($child); } $component->prepare(); }
/** * Prepare component configuration * * @return void * @throws \Magento\Framework\Exception\LocalizedException */ public function prepare() { $formElement = $this->getData('config/formElement'); if (null === $formElement) { throw new LocalizedException(__('The configuration parameter "formElement" is a required for "' . $this->getName() . '" field.')); } // Create of wrapped component $this->wrappedComponent = $this->uiComponentFactory->create($this->getName(), $formElement, array_merge(['context' => $this->getContext()], (array) $this->getData())); $this->wrappedComponent->prepare(); // Merge JS configuration with wrapped component configuration $wrappedComponentConfig = $this->getJsConfig($this->wrappedComponent); $jsConfig = array_replace_recursive($wrappedComponentConfig, $this->getJsConfig($this)); $jsConfig['extends'] = $this->wrappedComponent->getComponentName(); $this->setData('js_config', $jsConfig); $this->setData('config', array_replace_recursive((array) $this->wrappedComponent->getData('config'), (array) $this->getData('config'))); parent::prepare(); }
/** * Call prepare method in the component UI * * @param UiComponentInterface $component * @return void */ protected function prepareComponent(UiComponentInterface $component) { $childComponents = $component->getChildComponents(); if (!empty($childComponents)) { foreach ($childComponents as $child) { $this->prepareComponent($child); } } $component->prepare(); }