Example: JavaScript
Same name in other branches
- 7.x-1.x js_example/js_example.module \js_example
- 4.0.x modules/js_example/js_example.module \js_example
Examples using Drupal 8's built-in JavaScript.
We have two examples here.
One 'weights' content and then sorts it by weight. This demonstrates attaching JavaScript through Drupal's render arrays.
The other demonstrates adding an accordion effect to content, through Drupal's theme layer.
Parent topics
File
-
modules/
js_example/ js_example.module, line 8
Functions
Title Sort descending | File name | Summary |
---|---|---|
js_example_theme | modules/ |
Implements hook_theme(). |
Classes
Title Sort descending | File name | Summary |
---|---|---|
JsExampleTest | modules/ |
Functional tests for the js_example module. |