Change record status: 
Introduced in branch: 
8.x
Description: 

In D6 and D7, CTools provided the #dependency system to allow certain form elements to be dependent on others.

However, beginning in D8, Drupal Core provides the #states system to do the same thing.

Dependency used the HTML ID attribute, whereas States uses the HTML name attribute.

D7

$form['token_help'] = array(
  '#type' => 'fieldset',
  '#title' => t('Replacement patterns'),
  '#collapsible' => TRUE,
  '#collapsed' => TRUE,
  '#value' => $output,
  '#id' => 'edit-options-token-help',
  '#dependency' => array(
    'edit-options-tokenize' => array(1),
  ),
);

D8

$form['token_help'] = array(
  '#type' => 'fieldset',
  '#title' => t('Replacement patterns'),
  '#collapsible' => TRUE,
  '#collapsed' => TRUE,
  '#value' => $output,
  '#id' => 'edit-options-token-help',
  '#states' => array(
    'visible' => array(
      ':input[name="options[tokenize]"]' => array('checked' => TRUE),
    ),
  ),
);
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done