Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. /**
  2. * Implements hook_libraries_info().
  3. *
  4. */
  5. function MYMODULE_libraries_info() {
  6.  
  7. // Define 'simple' as the machine name of library
  8. // which will be stored in sites/all/libraries/simple
  9. $libraries['simple'] = array(
  10.  
  11. // This gets passed to the $options array in libraries_get_version()
  12. 'version arguments' => array(
  13. 'file' => 'simple.js',
  14. 'pattern' => '/Version (d+)/',
  15. 'lines' => 5,
  16. ),
  17.  
  18. // Alternatively, MYMODULE_version_callback could be defined.
  19. // this function returns TRUE/FALSE if it finds a valid version of the library
  20. //'version callback' => 'MYMODULE_version_callback',
  21.  
  22. // Defines the PHP,JS,CSS files to load for the library
  23. 'files' => array(
  24. 'js' => array('simple.js'), //this can be a path to the file location like array('lib/simple.js')
  25. ),
  26. );
  27.  
  28. return $libraries;
  29. }
  30.  
  31. //Load the 'simple' library
  32. libraries_load('simple');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement