boykodev

Drupal add library

Apr 3rd, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. // Add as a library
  2.   drupal_add_library('project18', 'project18_block', TRUE);
  3. ...
  4. /**
  5.  * Implements hook_library().
  6.  */
  7. function project18_library() {
  8.   $libraries['project18_block'] = array(
  9.     'title' => 'Project 18 Block library',
  10.     'js' => array(
  11.       drupal_get_path('module', 'project18') . '/js/ajax_refresh.js'
  12.     ),
  13.     'css' => array(
  14.       drupal_get_path('module', 'project18') . '/css/style.css' => array(
  15.         'type' => 'file'
  16.       ),
  17.     )
  18.   );
  19. }
Advertisement
Add Comment
Please, Sign In to add comment