code: public function setSettings($settings)
      {
          if (is_null($this->model)) {
              throw new Exception("You must set the model before you can set the settings.");
          }
          $this->_settings = $this->model->formSettings($this->name, $settings);
          if (is_null($this->_settings) and !empty($settings)) {
              $this->_settings = $settings;
          }
          if (empty($this->_settings['fields'])) {
              $this->_settings['fields'] = [];
          }
      }
docs: Set settings.
  
  @param [[@doctodo param_type:settings]] $settings [[@doctodo param_description:settings]]
  
  @throws Exception [[@doctodo exception_description:Exception]]