當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UiComponentInterface::prepare方法代碼示例

本文整理匯總了PHP中Magento\Framework\View\Element\UiComponentInterface::prepare方法的典型用法代碼示例。如果您正苦於以下問題:PHP UiComponentInterface::prepare方法的具體用法?PHP UiComponentInterface::prepare怎麽用?PHP UiComponentInterface::prepare使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\View\Element\UiComponentInterface的用法示例。


在下文中一共展示了UiComponentInterface::prepare方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: prepare

 /**
  * 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);
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:19,代碼來源:Column.php

示例2: prepare

 /**
  * 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();
 }
開發者ID:niranjanssiet,項目名稱:magento2,代碼行數:20,代碼來源:Column.php

示例3: 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);
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:21,代碼來源:Field.php

示例4: prepareComponent

 /**
  * 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();
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:13,代碼來源:Render.php

示例5: 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();
 }
開發者ID:kid17,項目名稱:magento2,代碼行數:23,代碼來源:Field.php

示例6: prepareComponent

 /**
  * 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();
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:16,代碼來源:Render.php


注:本文中的Magento\Framework\View\Element\UiComponentInterface::prepare方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。