508c0b951d90eeab85e64782cd454cefc539a9d7
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / library.twig
1 /**
2  * Implements hook_library().
3  */
4 function {{ machine_name }}_library() {
5   // Library One.
6   $libraries['library-1'] = array(
7     'title' => 'Library One',
8     'website' => 'http://example.com/library-1',
9     'version' => '1.2',
10     'js' => array(
11       drupal_get_path('module', 'my_module') . '/library-1.js' => array(),
12     ),
13     'css' => array(
14       drupal_get_path('module', 'my_module') . '/library-2.css' => array(
15         'type' => 'file',
16         'media' => 'screen',
17       ),
18     ),
19   );
20   // Library Two.
21   $libraries['library-2'] = array(
22     'title' => 'Library Two',
23     'website' => 'http://example.com/library-2',
24     'version' => '3.1-beta1',
25     'js' => array(
26       // JavaScript settings may use the 'data' key.
27       array(
28         'type' => 'setting',
29         'data' => array('library2' => TRUE),
30       ),
31     ),
32     'dependencies' => array(
33       // Require jQuery UI core by System module.
34       array('system', 'ui'),
35       // Require our other library.
36       array('my_module', 'library-1'),
37       // Require another library.
38       array('other_module', 'library-3'),
39     ),
40   );
41   return $libraries;
42 }