예제 #1
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     $config = $this->getData('config');
     if (isset($this->options)) {
         if (!isset($config['options'])) {
             $config['options'] = [];
         }
         if ($this->options instanceof OptionSourceInterface) {
             $options = $this->options->toOptionArray();
         } else {
             $options = array_values($this->options);
         }
         $config['options'] = array_values(array_merge_recursive($options, $config['options']));
     }
     $this->setData('config', (array) $config);
     parent::prepare();
 }
예제 #2
0
파일: Select.php 프로젝트: opexsw/magento2
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     parent::prepare();
     $config = $this->getData('config');
     if (isset($this->options)) {
         if (!isset($config['options'])) {
             $config['options'] = [];
         }
         if ($this->options instanceof OptionSourceInterface) {
             $options = $this->options->toOptionArray();
         } else {
             $options = array_values($this->options);
         }
         $config['options'] = array_values(array_merge_recursive($options, $config['options']));
     }
     $this->setData('config', (array) $config);
     $jsConfig = $this->getConfiguration($this, Input::NAME);
     $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
 }