Mercurial > hg > cmmr2012-drupal-site
annotate vendor/chi-teck/drupal-code-generator/templates/d7/hook/library.twig @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
rev | line source |
---|---|
Chris@0 | 1 /** |
Chris@0 | 2 * Implements hook_library(). |
Chris@0 | 3 */ |
Chris@0 | 4 function {{ machine_name }}_library() { |
Chris@0 | 5 // Library One. |
Chris@0 | 6 $libraries['library-1'] = array( |
Chris@0 | 7 'title' => 'Library One', |
Chris@0 | 8 'website' => 'http://example.com/library-1', |
Chris@0 | 9 'version' => '1.2', |
Chris@0 | 10 'js' => array( |
Chris@0 | 11 drupal_get_path('module', 'my_module') . '/library-1.js' => array(), |
Chris@0 | 12 ), |
Chris@0 | 13 'css' => array( |
Chris@0 | 14 drupal_get_path('module', 'my_module') . '/library-2.css' => array( |
Chris@0 | 15 'type' => 'file', |
Chris@0 | 16 'media' => 'screen', |
Chris@0 | 17 ), |
Chris@0 | 18 ), |
Chris@0 | 19 ); |
Chris@0 | 20 // Library Two. |
Chris@0 | 21 $libraries['library-2'] = array( |
Chris@0 | 22 'title' => 'Library Two', |
Chris@0 | 23 'website' => 'http://example.com/library-2', |
Chris@0 | 24 'version' => '3.1-beta1', |
Chris@0 | 25 'js' => array( |
Chris@0 | 26 // JavaScript settings may use the 'data' key. |
Chris@0 | 27 array( |
Chris@0 | 28 'type' => 'setting', |
Chris@0 | 29 'data' => array('library2' => TRUE), |
Chris@0 | 30 ), |
Chris@0 | 31 ), |
Chris@0 | 32 'dependencies' => array( |
Chris@0 | 33 // Require jQuery UI core by System module. |
Chris@0 | 34 array('system', 'ui'), |
Chris@0 | 35 // Require our other library. |
Chris@0 | 36 array('my_module', 'library-1'), |
Chris@0 | 37 // Require another library. |
Chris@0 | 38 array('other_module', 'library-3'), |
Chris@0 | 39 ), |
Chris@0 | 40 ); |
Chris@0 | 41 return $libraries; |
Chris@0 | 42 } |