当前位置: 首页>>代码示例>>PHP>>正文


PHP Form\ConfigFormBase类代码示例

本文整理汇总了PHP中Drupal\Core\Form\ConfigFormBase的典型用法代码示例。如果您正苦于以下问题:PHP ConfigFormBase类的具体用法?PHP ConfigFormBase怎么用?PHP ConfigFormBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ConfigFormBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: submitForm

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $config = $this->configFactory->getEditable('commerce_cart.settings');
    $config->set('cart_page.view',  $form_state->getValue('view'));
    $config->save();

    parent::submitForm($form, $form_state);
  }
开发者ID:housineali,项目名称:drpl8_dv,代码行数:10,代码来源:CartSettingsForm.php

示例2: submitForm

 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     $config = $this->config('hugs.settings');
     $config->set('default_count', $form_state->getValue('default_count'));
     $config->save();
 }
开发者ID:sriharisahu,项目名称:hugs,代码行数:7,代码来源:ConfigForm.php

示例3: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $config = $this->config('configform_example.settings');
     $config->set('email_address', $form_state->getValue('email'));
     $config->save();
     return parent::submitForm($form, $form_state);
 }
开发者ID:selwynpolit,项目名称:d8_test2,代码行数:10,代码来源:ConfigFormExampleConfigForm.php

示例4: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     // $config = $this->config('idmygadget.settings');
     // $config->set('idmygadget_', $form_state->getValue('idmygadget_'));
     // $config->save();
 }
开发者ID:tomwhartung,项目名称:jmws_idMyGadget_for_drupal-d8,代码行数:10,代码来源:ConfigFormIdMyGadgetBase.php

示例5: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     parent::submitForm($form, $form_state);
     // normalize line endings to \n
     $selectors = preg_replace('/[\\r\\n]+/', "\n", $form_state->getValue('exclude_hover_selectors'));
     $this->config('pinterest_hover.settings')->set('load_pinterest_js', $form_state->getValue('load_pinterest_js'))->set('exclude_hover_selectors', $selectors)->save();
 }
开发者ID:mbaynton,项目名称:pinterest_responsive,代码行数:10,代码来源:ConfigForm.php

示例6: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state) {
   $this->config('dropdown_language.setting')
     ->set('wrapper', $form_state->getValue('wrapper'))
     ->save();
   parent::submitForm($form, $form_state);
   Cache::invalidateTags(['rendered']);
 }
开发者ID:eloiv,项目名称:botafoc.cat,代码行数:10,代码来源:DropdownLanguageSettings.php

示例7: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     // Remove unnecessary values.
     form_state_values_clean($form_state);
     $this->config('faq.settings')->set('use_categories', $form_state['values']['faq_use_categories'])->set('category_display', $form_state['values']['faq_category_display'])->set('category_listing', $form_state['values']['faq_category_listing'])->set('category_hide_qa_accordion', $form_state['values']['faq_category_hide_qa_accordion'])->set('count', $form_state['values']['faq_count'])->set('answer_category_name', $form_state['values']['faq_answer_category_name'])->set('group_questions_top', $form_state['values']['faq_group_questions_top'])->set('hide_child_terms', $form_state['values']['faq_hide_child_terms'])->set('show_term_page_children', $form_state['values']['faq_show_term_page_children'])->set('omit_vocabulary', $form_state['values']['faq_omit_vocabulary'])->save();
     parent::submitForm($form, $form_state);
 }
开发者ID:anyforsoft,项目名称:csua_d8,代码行数:10,代码来源:CategoriesForm.php

示例8: buildForm

 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $cors_domains = '';
     $config_cors = $this->configFactory->get('cors.config')->get('cors_domains');
     if (!empty($config_cors)) {
         foreach ($config_cors as $path => $domain) {
             $cors_domains .= $path . '|' . $domain . "\n";
         }
     }
     $form = array();
     $form['cors_domains'] = array('#type' => 'textarea', '#title' => t('Domains'), '#description' => t('A list of paths and corresponding domains to enable for CORS. Multiple entries should be separated by a comma. Enter one value per line separated by a pipe, in this order:
  <ul>
    <li>Internal path</li>
    <li>Access-Control-Allow-Origin. Use &lt;mirror&gt; to echo back the Origin header.</li>
    <li>Access-Control-Allow-Methods</li>
    <li>Access-Control-Allow-Headers</li>
    <li>Access-Control-Allow-Credentials</li>
   </ul>
   Examples:
   <ul>
     <li>*|http://example.com</li>
     <li>api|http://example.com:8080 http://example.com</li>
     <li>api/*|&lt;mirror&gt;,https://example.com</li>
     <li>api/*|&lt;mirror&gt;|POST|Content-Type,Authorization|true</li>
   </ul>'), '#default_value' => $cors_domains, '#rows' => 10);
     return parent::buildForm($form, $form_state);
 }
开发者ID:nuxy,项目名称:cors,代码行数:27,代码来源:CorsConfigForm.php

示例9: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $bdd_ivw_settings = $this->config('bdd_ivw.settings');
     $form['current_code'] = array('#markup' => 'Current Default Code: ' . $this->token->replace($bdd_ivw_settings->get('code_template'), array(), array('sanitize' => FALSE)));
     $form['settings'] = array('#type' => 'vertical_tabs', '#default_tab' => 'site_settings');
     $form['site_settings'] = array('#type' => 'details', '#title' => t('Site settings'), '#collapsible' => FALSE, '#collapsed' => FALSE, '#group' => 'ivw_settings');
     $form['default_values'] = array('#type' => 'details', '#title' => t('Default values'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'ivw_settings');
     $form['site_settings']['site'] = array('#type' => 'textfield', '#title' => t('IVW Site name'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('site'), '#description' => t('Site name as given by IVW, this is used as default for the "st" parameter in the iam_data object'));
     $form['site_settings']['code_template'] = array('#type' => 'textfield', '#title' => t('Code template'), '#required' => TRUE, '#maxlength' => 256, '#size' => 128, '#default_value' => $bdd_ivw_settings->get('code_template'), '#description' => t('Code template, for creating the actual ivw code.'));
     $form['site_settings']['code_template_token_tree'] = array('#theme' => 'token_tree', '#token_types' => ['ivw']);
     $form['site_settings']['responsive'] = array('#type' => 'checkbox', '#title' => t('Site is responsive'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('responsive'), '#description' => t('Responsive sites must handle mobile code in javascript, this is activated here.'));
     $form['site_settings']['mobile_width'] = array('#type' => 'textfield', '#states' => array('invisible' => array(':input[name="ivw_responsive"]' => array('checked' => FALSE))), '#title' => t('Mobile width'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('mobile_width'), '#description' => t('On a responsive site, this value tells the javascript up to which screen width, the device should be treated as mobile.'));
     $form['default_values']['offering_default'] = array('#type' => 'textfield', '#title' => t('Fallback offering code'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('offering_default'), '#description' => t('A single ivw site can have multiple offerings, they can be differentiated by different numbers.'), '#min' => 1);
     $form['default_values']['offering_overridable'] = array('#type' => 'checkbox', '#title' => t('Offering code is overrideable'), '#default_value' => $bdd_ivw_settings->get('offering_overridable'));
     $form['default_values']['language_default'] = array('#type' => 'select', '#options' => array(1 => 'Deutsch', 2 => 'Andere Sprache, Inhalt prüfbar', 3 => 'Andere Sprache, Inhalt nicht prüfbar'), '#title' => t('Fallback language'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('language_default'));
     $form['default_values']['language_overridable'] = array('#type' => 'checkbox', '#title' => t('Language code is overrideable'), '#default_value' => $bdd_ivw_settings->get('language_overridable'));
     $form['default_values']['format_default'] = array('#type' => 'select', '#options' => array(1 => 'Bild/Text', 2 => 'Audio', 3 => 'Video', 4 => 'Andere dynamische Formate'), '#title' => t('Fallback format'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('format_default'));
     $form['default_values']['format_overridable'] = array('#type' => 'checkbox', '#title' => t('Format code is overrideable'), '#default_value' => $bdd_ivw_settings->get('format_overridable'));
     $form['default_values']['creator_default'] = array('#type' => 'select', '#options' => array(1 => 'Redaktion', 2 => 'User', 3 => 'Unbekannt'), '#title' => t('Fallback creator'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('creator_default'));
     $form['default_values']['creator_overridable'] = array('#type' => 'checkbox', '#title' => t('Creator code is overrideable'), '#default_value' => $bdd_ivw_settings->get('creator_overridable'));
     $form['default_values']['homepage_default'] = array('#type' => 'select', '#options' => array(1 => 'Homepage des Angebots', 2 => 'Keine Homepage', 3 => 'Hompage der Fremddomains bei Multi-Angeboten'), '#title' => t('Fallback homepage flag'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('homepage_default'));
     $form['default_values']['homepage_overridable'] = array('#type' => 'checkbox', '#title' => t('Homepage flag is overridable'), '#default_value' => $bdd_ivw_settings->get('homepage_overridable'));
     $form['default_values']['delivery_default'] = array('#type' => 'select', '#options' => array(1 => 'Online', 2 => 'Mobile', 3 => 'Connected TV'), '#title' => t('Fallback delivery'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('delivery_default'));
     $form['default_values']['delivery_overridable'] = array('#type' => 'checkbox', '#title' => t('Delivery flag is overridable'), '#default_value' => $bdd_ivw_settings->get('delivery_overridable'));
     $form['default_values']['app_default'] = array('#type' => 'select', '#options' => array(1 => 'App', 2 => 'Keine App'), '#title' => t('Fallback app flag'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('app_default'));
     $form['default_values']['app_overridable'] = array('#type' => 'checkbox', '#title' => t('App flag is overridable'), '#default_value' => $bdd_ivw_settings->get('app_overridable'));
     $form['default_values']['paid_default'] = array('#type' => 'select', '#options' => array(1 => 'Paid', 2 => 'Nicht zugeordnet'), '#title' => t('Fallback paid flag'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('paid_default'));
     $form['default_values']['paid_overridable'] = array('#type' => 'checkbox', '#title' => t('Paid flag is overridable'), '#default_value' => $bdd_ivw_settings->get('paid_overridable'));
     $form['default_values']['content_default'] = array('#type' => 'select', '#options' => array('01' => 'Nachrichten', '02' => 'Sport', '03' => 'Entertainment/Boulevard/Stars/Film/Musik', '04' => 'Fashion/Beauty', '05' => 'Familie/Kinder/Lebenshilfe', '06' => 'Liebe/Psychologie/Beziehungen', '07' => 'Fahrzeuge/Verkehr/Mobilität', '08' => 'Reise/Touristik', '09' => 'Computer', '10' => 'Consumer Electronics', '11' => 'Telekommunikation/Internetdienste', '12' => 'Spiele', '13' => 'Wohnen/Immobilien/Garten/Haushalt', '14' => 'Wirtschaft/Finanzen/Job/Karriere', '15' => 'Gesundheit', '16' => 'Essen/Trinken', '17' => 'Kunst/Kultur/Literatur', '18' => 'Erotik', '19' => 'Wissenschaft/Bildung/Natur/Umwelt', '20' => 'Angebotsinformation', '21' => 'Vermischtes (multithematisch)', '22' => 'Sonstiges (monothematisch)', '23' => 'Übersichtsseite zu Spiele', '24' => 'Casual Games', '25' => 'Core Games', '26' => 'Sonstiges (Bereich Spiele)', '27' => 'Social Networking - Privat', '28' => 'Social Networking - Business', '29' => 'Partnersuche/Dating', '30' => 'Newsletter', '31' => 'E-Mail/SMS/E-Cards', '32' => 'Messenger/Chat', '33' => 'Sonstiges (Bereich Networking/Kommunikation', '34' => 'Suchmaschinen', '35' => 'Verzeichnisse/Auskunftsdienste', '36' => 'Sonstiges (Bereich Suchmaschinen/Verzeichnisse)', '37' => 'Onlineshops/Shopping Mall/Auktionen/B2bMarktplätze', '38' => 'Immobilien Rubrikenmärkte/Kleinanzeigen', '39' => 'Jobs Rubrikenmärkte/Kleinanzeigen', '40' => 'Fahrzeuge Rubrikenmärkte/Kleinanzeigen', '41' => 'Sonstiges Rubrikenmärkte/Kleinanzeigen', '42' => 'Sonstiges (Bereich E-Commerce)'), '#title' => t('Fallback content category'), '#required' => TRUE, '#default_value' => $bdd_ivw_settings->get('content_default'));
     $form['default_values']['content_overridable'] = array('#type' => 'checkbox', '#title' => t('Content category is overridable'), '#default_value' => $bdd_ivw_settings->get('content_overridable'));
     return parent::buildForm($form, $form_state);
 }
开发者ID:Cyberschorsch,项目名称:module-ivw_integration,代码行数:35,代码来源:SettingsForm.php

示例10: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     module_load_include('inc', 'sociallogin');
     $data = get_authentication($form_state->getValue('api_key'), $form_state->getValue('api_secret'));
     if (isset($data['status']) && $data['status'] != 'status') {
         drupal_set_message($data['message'], $data['status']);
         return FALSE;
     }
     parent::SubmitForm($form, $form_state);
     $this->config('sociallogin.settings')->set('sso_site_name', $form_state->getValue('sso_site_name'))->set('api_key', $form_state->getValue('api_key'))->set('api_secret', $form_state->getValue('api_secret'))->set('username_option', $form_state->getValue('username_option'))->set('login_redirection', $form_state->getValue('login_redirection'))->set('register_redirection', $form_state->getValue('register_redirection'))->set('custom_login_url', $form_state->getValue('custom_login_url'))->set('custom_register_url', $form_state->getValue('custom_register_url'))->set('enable_linking', $form_state->getValue('enable_linking'))->set('linking_text', $form_state->getValue('linking_text'))->save();
     if (count(\Drupal::moduleHandler()->getImplementations('add_extra_sociallogin_config_settings')) > 0) {
         // Call all modules that implement the hook, and let them make changes to $variables.
         $config_data = \Drupal::moduleHandler()->invokeAll('add_extra_sociallogin_config_settings');
     }
     if (isset($config_data) && is_array($config_data)) {
         foreach ($config_data as $key => $value) {
             $this->config('sociallogin.settings')->set($value, $form_state->getValue($value))->save();
         }
     }
     drupal_set_message(t('Social Login settings have been saved.'), 'status');
     //Clear page cache
     foreach (Cache::getBins() as $service_id => $cache_backend) {
         if ($service_id == 'dynamic_page_cache') {
             $cache_backend->deleteAll();
         }
     }
 }
开发者ID:LoginRadius,项目名称:drupal-identity-module,代码行数:30,代码来源:SocialLoginSettingsForm.php

示例11: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $form = parent::buildForm($form, $form_state);
     $account = $this->currentUser();
     if (!$account->hasPermission('administer icepay config')) {
         $form['notice'] = array('#markup' => '<div>' . $this->t('You must have access to <b>administer icepay config</b> to adjust these settings.') . '</div>');
         return $form;
     }
     $ice_config = $this->config('uc_icepay.settings');
     $form['icepay_merchant'] = array('#type' => 'details', '#title' => $this->t('Merchant details'), '#description' => $this->t('Please insert merchant details you have received from IcePay.'), '#open' => false, '#weight' => 1, '#attached' => array('library' => array('uc_icepay/uc_icepay.hideshow', 'uc_icepay/uc_icepay.admin-merchant')));
     $form['icepay_merchant']['uc_icepay_merchant_id'] = array('#type' => 'textfield', '#title' => $this->t('Merchant ID'), '#default_value' => $ice_config->get('merchant_id'));
     $form['icepay_merchant']['uc_icepay_secret_code'] = array('#type' => 'textfield', '#title' => $this->t('Secret code'), '#default_value' => $ice_config->get('secret_code'), '#suffix' => '<p><a href="#" id="icepay-merchant-showhide-secret">show pass</a></p>');
     $form['icepay_general'] = array('#type' => 'details', '#title' => $this->t('General settings'), '#description' => $this->t('Needed for Icepay API can be used properly.'), '#weight' => 3, '#open' => false);
     $icepay_statics = new IcepayStatics();
     $form['icepay_general']['uc_icepay_country'] = array('#type' => 'select', '#title' => $this->t('Country'), '#options' => $icepay_statics->getCountriesOption(), '#default_value' => $ice_config->get('country'));
     $form['icepay_general']['uc_icepay_language'] = array('#type' => 'select', '#title' => $this->t('Language'), '#options' => $icepay_statics->getLanguagesOption(), '#default_value' => $ice_config->get('language'));
     $form['icepay_general']['uc_icepay_currency'] = array('#type' => 'select', '#title' => $this->t('Currency'), '#options' => $icepay_statics->getCurrenciesOption(), '#default_value' => $ice_config->get('currency'));
     $form['icepay_general']['uc_icepay_mailing'] = array('#default_value' => $ice_config->get('mailing'));
     $form['icepay_general']['uc_icepay_stream_method'] = array('#type' => 'select', '#title' => $this->t('API connect method'), '#options' => array('CURL' => $this->t('CURL (recommended)'), 'FOPEN' => $this->t('FOPEN (requires allow_url_fopen)')), '#default_value' => $ice_config->get('stream_method'));
     $form['icepay_general']['uc_icepay_ipcheck'] = array('#type' => 'checkbox', '#title' => $this->t('IP check on postback'), '#default_value' => $ice_config->get('ipcheck'));
     $form['icepay_general']['uc_icepay_https_protocol'] = array('#type' => 'checkbox', '#title' => $this->t('Use API HTTPS protocol'), '#default_value' => $ice_config->get('https_protocol'));
     $form['icepay_url'] = array('#type' => 'details', '#title' => $this->t('ICEPAY merchant URL'), '#description' => $this->t('You can set another URL to handle success or error returned from Icepay provider.'), '#weight' => 5, '#open' => false);
     global $base_url;
     $form['icepay_url']['uc_icepay_url_ok'] = array('#type' => 'textfield', '#title' => $this->t('OK / success URL'), '#default_value' => $ice_config->get('url.ok'), '#description' => $this->t('When changed, do not forget to change it on your ICEPAY merchant account.'), '#field_prefix' => $base_url . '/');
     $form['icepay_url']['uc_icepay_url_err'] = array('#type' => 'textfield', '#title' => $this->t('Error URL'), '#default_value' => $ice_config->get('url.err'), '#description' => $this->t('When changed, do not forget to change it on your ICEPAY merchant account.'), '#field_prefix' => $base_url . '/');
     $form['icepay_url']['uc_icepay_url_notify'] = array('#type' => 'textfield', '#title' => $this->t('Notify / Postback URL'), '#default_value' => $ice_config->get('url.notify'), '#description' => $this->t('When changed, do not forget to change it on your ICEPAY merchant account.'), '#field_prefix' => $base_url . '/');
     $form['icepay_disclaimer'] = array('#type' => 'details', '#title' => $this->t('Disclaimer'), '#description' => $this->t("The merchant is entitled to change de ICEPAY plug-in code, any changes will be at merchant's own risk.") . '<br>' . $this->t("Requesting ICEPAY support for a modified plug-in will be charged in accordance with the standard ICEPAY rates."), '#open' => true, 'icepay_support_link' => array('#type' => 'item', '#markup' => $this->t('For ICEPAY technical suppport, !link', ['!link' => '<a href="https://icepay.com/support" target="_blank">https://icepay.com/support</a>'])));
     $form['icepay_ideal_issuers'] = array('#type' => 'details', '#title' => t('iDeal issuers'), '#description' => t('You can set which iDeal issuers to be made available as option during checkout process.'), '#weight' => 6);
     $static = new IcepayStatics();
     foreach ($static->getIdealIssuersOption() as $code => $issuer) {
         $form['icepay_ideal_issuers']['uc_icepay_ideal_issuer_' . $code] = array('#type' => 'checkbox', '#title' => $issuer, '#default_value' => $ice_config->get('ideal_issuer.' . $code));
     }
     return $form;
 }
开发者ID:winnie80,项目名称:uc_icepay,代码行数:37,代码来源:IcepaySettingsForm.php

示例12: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL)
 {
     $config = $this->config('easychart.settings');
     $load_defaults = FALSE;
     // Get defaults.
     foreach ($this->getDefaults() as $default) {
         // Verify default options.
         $default_value = $config->get($default);
         if (empty($default_value)) {
             // Set flag to true.
             $load_defaults = TRUE;
             $form['#attached']['drupalSettings']['easychart'][$default] = TRUE;
         }
     }
     if ($load_defaults) {
         $form['#attached']['library'][] = 'easychart/easychart.defaults';
         $form['#attached']['library'][] = 'easychart/lib.easycharts.full';
     }
     $options = $config->get('options');
     $form['options'] = ['#type' => 'textarea', '#title' => $this->t('Available options'), '#description' => $this->t('These Highcharts options will be configurable in the Easychart interface when creating/editing a chart. See <a href="@url" target="_blank">http://api.highcharts.com/highcharts</a> for all available options.', array('@url' => Url::fromUri('http://api.highcharts.com/highcharts')->toUriString())), '#default_value' => $options, '#attributes' => array('class' => array('easychart-options')), '#rows' => 15];
     $form['templates'] = ['#type' => 'textarea', '#title' => t('Available templates'), '#default_value' => $config->get('templates'), '#description' => t("These templates will be selectable in the Easychart interface when creating/editing a chart."), '#attributes' => array('class' => array('easychart-templates')), '#rows' => 15];
     $form['presets'] = ['#type' => 'textarea', '#title' => t('Presets'), '#default_value' => $config->get('presets'), '#description' => $this->t('Presets for every Easychart chart. If these preset are also mentioned in the available options, they will be shown, but not editable.'), '#attributes' => array('class' => array('easychart-presets')), '#rows' => 10];
     $interval = array(3600, 10800, 21600, 32400, 43200, 86400, 172800);
     $form['url_update_frequency'] = ['#type' => 'select', '#title' => t('Update frequency'), '#options' => array(0 => t('Never')) + array_map([\Drupal::service('date.formatter'), 'formatInterval'], array_combine($interval, $interval)), '#default_value' => $config->get('url_update_frequency'), '#description' => $this->t('When to update the data for charts using a CSV URL.'), '#rows' => 10];
     $form['actions']['reset'] = ['#type' => 'submit', '#value' => t('Reset to defaults'), '#submit' => array('::resetForm'), '#limit_validation_errors' => array(), '#weight' => 100];
     return parent::buildForm($form, $form_state);
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:30,代码来源:SettingsForm.php

示例13: __construct

 /**
  * Constructs a \Drupal\system\CustomFieldFormBase object.
  *
  * @param \Drupal\Core\Config\ConfigFactory $config_factory
  *   The factory for configuration objects.
  * @param \Drupal\Core\Entity\EntityTypeManager
  *   The entity type manager.
  * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface
  *   The cache invalidator.
  * @param \Drupal\Core\Extension\ModuleHandler
  *   The module handler.
  */
 public function __construct(ConfigFactory $config_factory, EntityTypeManagerInterface $entity_type_manager, CacheTagsInvalidatorInterface $cache_invalidator, ModuleHandler $module_handler)
 {
     parent::__construct($config_factory);
     $this->entityTypeManager = $entity_type_manager;
     $this->cacheInvalidator = $cache_invalidator;
     $this->moduleHandler = $module_handler;
 }
开发者ID:neeravbm,项目名称:unify-d8,代码行数:19,代码来源:FieldFormBase.php

示例14: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     // Remove unnecessary values.
     form_state_values_clean($form_state);
     $this->config('faq.settings')->set('display', $form_state['values']['faq_display'])->set('question_listing', $form_state['values']['faq_question_listing'])->set('qa_mark', $form_state['values']['faq_qa_mark'])->set('question_label', $form_state['values']['faq_question_label'])->set('answer_label', $form_state['values']['faq_answer_label'])->set('question_length', $form_state['values']['faq_question_length'])->set('question_long_form', $form_state['values']['faq_question_long_form'])->set('hide_qa_accordion', $form_state['values']['faq_hide_qa_accordion'])->set('show_expand_all', $form_state['values']['faq_show_expand_all'])->set('use_teaser', $form_state['values']['faq_use_teaser'])->set('back_to_top', $form_state['values']['faq_back_to_top'])->set('disable_node_links', $form_state['values']['faq_disable_node_links'])->set('default_sorting', $form_state['values']['faq_default_sorting'])->save();
     parent::submitForm($form, $form_state);
 }
开发者ID:anyforsoft,项目名称:csua_d8,代码行数:10,代码来源:QuestionsForm.php

示例15: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state) {
   parent::submitForm($form, $form_state);
   $this->config('logouttab.settings')
     ->set('url', $form_state->getValue('url'))
     ->set('weight', $form_state->getValue('weight'))
     ->save();
 }
开发者ID:eloiv,项目名称:botafoc.cat,代码行数:10,代码来源:LogouttabSettingsForm.php


注:本文中的Drupal\Core\Form\ConfigFormBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。