Created
April 25, 2016 21:04
-
-
Save reubenmoes/9e2b04b12825dc5579bc68646a64a96d to your computer and use it in GitHub Desktop.
Attach JS to a drupal block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//put this in hook_bock_view | |
$block['content'] = array( | |
///.... | |
'#attached' => array( | |
'css' => array( | |
drupal_get_path('module', 'mymodule') . '/css/mymodule.css', | |
), | |
'js' => array( | |
drupal_get_path('module', 'mymodule') . '/js/mymodule.js', | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment