public function loadConfiguration()
 {
     $builder = $this->getContainerBuilder();
     $config = $this->getConfig();
     foreach ($config as $name => $configuration) {
         if ($configuration) {
             $config[$name] = new Theme($name, Arrays::merge_only_exist_keys($this->themeDefaults, $configuration));
         } else {
             $config[$name] = new Theme($name, $this->themeDefaults);
         }
     }
     $builder->addDefinition($this->prefix('ThemeKeeper'))->setClass('ThemeKeeper\\ThemeKeeper', array($config));
 }
Example #2
0
 /**
  * @param array $offsets
  * @return array
  */
 public function setOffsets($offsets)
 {
     if (isset($offsets['optional_lft']) && strlen($offsets['optional_lft']) > 1) {
         throw new InvalidParameter("Start char of optional block must be type of char:" . $offsets['optional_lft']);
     }
     if (isset($offsets['optional_rgt']) && strlen($offsets['optional_rgt']) > 1) {
         throw new InvalidParameter("End char of optional block must be type of char:" . $offsets['optional_rgt']);
     }
     $this->offsets = Arrays::merge_only_exist_keys($this->defaultOffsets, $offsets);
 }