3 namespace Drupal\memcache_admin\Form;
5 use Drupal\Core\Form\ConfigFormBase;
6 use Drupal\Core\Form\FormStateInterface;
9 * Memcache admin settings form.
11 class MemcacheAdminSettingsForm extends ConfigFormBase {
16 public function getFormId() {
17 return 'memcache_admin_admin_settings';
23 public function buildForm(array $form, FormStateInterface $form_state) {
24 $form['show_memcache_statistics'] = [
25 '#type' => 'checkbox',
26 '#title' => t('Show memcache statistics at the bottom of each page'),
27 '#default_value' => \Drupal::config('memcache_admin.settings')->get('show_memcache_statistics'),
28 '#description' => t("These statistics will be visible to users with the 'access memcache statistics' permission."),
31 return parent::buildForm($form, $form_state);
37 public function getEditableConfigNames() {
38 return ['memcache_admin.settings'];
44 public function submitForm(array &$form, FormStateInterface $form_state) {
45 $this->config('memcache_admin.settings')
46 ->set('show_memcache_statistics', $form_state->getValue('show_memcache_statistics'))
49 parent::submitForm($form, $form_state);