Пример #1
0
 /**
  * Get the bootstrap config for the form context.
  *
  * @param \FormModel|null $formModel The form model to which the widget belongs.
  *
  * @return ContextualConfig
  */
 protected static function getConfig($formModel = null)
 {
     if (!$formModel) {
         return Bootstrap::getConfig();
     }
     if (!isset(static::$configs[$formModel->id])) {
         $collection = BootstrapConfigModel::findMultipleByIds(deserialize($formModel->bootstrap_configs, true));
         $config = static::getTypeManager()->buildContextualConfig($collection);
         static::$configs[$formModel->id] = $config;
     }
     return static::$configs[$formModel->id];
 }