Contao\Config::set PHP Метод

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

Temporarily set a configuration value
public static set ( string $strKey, string $varValue )
$strKey string The short key
$varValue string The configuration value
    public static function set($strKey, $varValue)
    {
        $GLOBALS['TL_CONFIG'][$strKey] = $varValue;
    }

Usage Example

Пример #1
0
 /**
  * Set the property
  *
  * @param string $key
  * @param int    $value
  *
  * @throws \InvalidArgumentException
  */
 public static function set($key, $value)
 {
     if (!in_array($key, static::getAllowedKeys(), true)) {
         throw new \InvalidArgumentException(sprintf('The key "%s" is not allowed', $key));
     }
     $data = static::getData();
     $data[$key] = (int) $value;
     Config::set(static::$configKey, serialize($data));
     Config::persist(static::$configKey, serialize($data));
 }
All Usage Examples Of Contao\Config::set