Skip to content

Create new Key Form API element #77

Description

@rlhawk

To make it easy for modules to integrate with Key, the version of the module for Drupal 7 adds a new form API element called key. It extends the select element, but fills #options with the list of available keys. It also provides additional instructions for using and defining keys in the #description. Here's an example of what that looks like in code:

$form['secret_key'] = array(
  '#type' => 'key',
  '#title' => t('Secret key'),
);

This functionality should be in the Drupal 8 version also. Key for D7 has additional functionality, such as filtering, that can be added later for D8.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions