Example: JavaScript in Examples for Developers 3.x
Same name and namespace in other branches
- 8 js_example/js_example.module \js_example
- 7 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 - Examples showing how to use some of the new JavaScript features in Drupal 8.
Functions
Name | Location | Description |
---|---|---|
js_example_theme |
modules/ |
Implements hook_theme(). |
Classes
Name | Location | Description |
---|---|---|
JsExampleTest |
modules/ |
Functional tests for the js_example module. |