This module provides a form element and widget for a visual on/off switch.
Installation
- Install this module and its dependencies using the official
Backdrop CMS instructions
Configuration and Usage
There are two ways to use the widget:
-
Field UI
A widget is provided for checkbox (boolean) fields. When creating a boolean
field, selectswitch
as the widget. -
Form API
The module defines a new form element typeswitch
- use as you would a
checkbox.
$form['example'] = array(
'#type' => 'switch',
'#title' => t('Example'),
);
Issues
Bugs and Feature requests should be reported in the Issue Queue
Current Maintainers
Credits
- Ported to Backdrop CMS by Laryn Kragt Bakker for
Aten Design Group. - Current maintainer for the Drupal module: Ben Scott.
License
This project is GPL v2 software. See the LICENSE.txt
file in this directory for complete text.