Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new Key Form API element #77

Open
rlhawk opened this issue Nov 10, 2015 · 0 comments
Open

Create new Key Form API element #77

rlhawk opened this issue Nov 10, 2015 · 0 comments
Assignees

Comments

@rlhawk
Copy link
Contributor

rlhawk commented Nov 10, 2015

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.

@rlhawk rlhawk self-assigned this Nov 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant