ExampleConfigEntityGeneralForm.php in Chaos Tool Suite (ctools) 8.3        
                          
                  
                        
  
  
  
  
  
File
  tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityGeneralForm.php
  
    View source  
  <?php
namespace Drupal\ctools_wizard_test\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class ExampleConfigEntityGeneralForm extends FormBase {
  
  public function getFormId() {
    return 'ctools_wizard_test_config_entity_general_form';
  }
  
  public function buildForm(array $form, FormStateInterface $form_state) {
    $cached_values = $form_state
      ->getTemporaryValue('wizard');
    
    $config_entity = $cached_values['ctools_wizard_test_config_entity'];
    
    return $form;
  }
  
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $cached_values = $form_state
      ->getTemporaryValue('wizard');
    
    $config_entity = $cached_values['ctools_wizard_test_config_entity'];
    $config_entity
      ->set('id', $form_state
      ->getValue('id'));
    $config_entity
      ->set('label', $form_state
      ->getValue('label'));
  }
}