set() публичный Метод

For example: $app['config']->set('general/branding/name', 'Bolt');
public set ( string $path, mixed $value ) : boolean
$path string
$value mixed
Результат boolean
Пример #1
0
 private function loadThemeConfig(Config $config, $theme, $childTheme)
 {
     $themePath = $this->app['resources']->getPath('themebase') . '/' . $theme;
     if (file_exists($themePath)) {
         $configFile = $themePath . '/config.yml';
         // insert parent path right after child path.
         $twigPath = $config->get('twigpath');
         if ($twigPath) {
             $childThemePath = $this->app['resources']->getPath('themebase') . '/' . $childTheme;
             $key = array_search($childThemePath, $twigPath);
             if ($key !== false) {
                 array_splice($twigPath, $key, 1, array($childThemePath, $themePath));
             }
             $config->set('twigpath', $twigPath);
         }
         if (file_exists($configFile)) {
             $themeConfig = self::mergeConfigFile($configFile);
             if ($themeConfig) {
                 // load parent theme config, but without overwriting, because child prevails
                 $config->set('theme', Arr::mergeRecursiveDistinct($themeConfig, $config->get('theme')));
                 // multiple levels allowed
                 if (!empty($themeConfig['parent'])) {
                     $this->loadThemeConfig($config, $themeConfig['parent'], $theme);
                 }
             }
         }
     }
 }