Adds attachments to a render() structure.
$build['#attached'] = array( 'js' => array(backdrop_get_path('module', 'taxonomy') . '/js/taxonomy.admin.js'), 'css' => array(backdrop_get_path('module', 'taxonomy') . '/css/taxonomy.css'), );
'js', 'css', and 'library' are types that get special handling. For any other kind of attached data, the array key must be the full name of the callback function and each value an array of arguments. For example:
$build['#attached']['backdrop_add_http_header'] = array( array('Content-Type', 'application/rss+xml; charset=utf-8'), );
External 'js' and 'css' files can also be loaded. For example:
$build['#attached']['js'] = array( 'http://code.jquery.com/jquery-1.4.2.min.js' => array( 'type' => 'external', ), );
$elements: The structured array describing the data being rendered.
$dependency_check: When TRUE, will exit if a given library's dependencies are missing. When set to FALSE, will continue to add the libraries, even though one or more dependencies are missing. Defaults to FALSE.
FALSE if there were any missing library dependencies; TRUE if all library: dependencies were met.
includes/ common.inc, line 5003
- Common functions that many Backdrop modules will need to reference.