Example: JavaScript in Examples for Developers 8
Same name and namespace in other branches
- 7 js_example/js_example.module \js_example
- 3.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
- 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 |
js_example/ |
Implements hook_theme(). |
Classes
Name | Location | Description |
---|---|---|
JsExampleTest |
js_example/ |
Functional tests for the js_example module. |