Example #1
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     $config = $this->getData('config');
     if (isset($config['keyInConfiguration']) && isset($config['valueFromConfig']) && $config['valueFromConfig'] instanceof ValueSourceInterface) {
         $config['valueFromConfig'] = $config['valueFromConfig']->getValue($config['keyInConfiguration']);
     }
     $this->setData('config', (array) $config);
     parent::prepare();
 }
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     $config = $this->getData('config');
     if (isset($config['keyInConfiguration']) && isset($config['valueFromConfig']) && $config['valueFromConfig'] instanceof ValueSourceInterface) {
         $keyInConfiguration = $config['valueFromConfig']->getValue($config['keyInConfiguration']);
         if (!empty($config['unserialized']) && strpos($keyInConfiguration, 'a:') === 0) {
             $config['valueFromConfig'] = unserialize($keyInConfiguration);
         } else {
             $config['valueFromConfig'] = $keyInConfiguration;
         }
     }
     $this->setData('config', (array) $config);
     parent::prepare();
 }