view vendor/chi-teck/drupal-code-generator/templates/d7/admin.inc.twig @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
line wrap: on
line source
<?php

/**
 * @file
 * Admin page callbacks for the {{ name }} module.
 */

/**
 * Form constructor for the main {{ name }} administration form.
 */
function {{ machine_name }}_settings_form($form, &$form_state) {

  $form['{{ machine_name }}_setting_1'] = array(
    '#type' => 'textfield',
    '#title' => t('Setting 1'),
    '#default_value' => variable_get('{{ machine_name }}_setting_1'),
  );
  $form['{{ machine_name }}_setting_2'] = array(
    '#type' => 'select',
    '#title' => t('Setting 1'),
    '#options' => array(t('Option 1'), t('Option 2'), t('Option 3')),
    '#default_value' => variable_get('{{ machine_name }}_setting_2'),
  );
  $form['{{ machine_name }}_setting_3'] = array(
    '#type' => 'checkbox',
    '#title' => t('Setting 3'),
    '#default_value' => variable_get('{{ machine_name }}_setting_3'),
  );

  return system_settings_form($form);
}