Skip to content

Instantly share code, notes, and snippets.

@RoySegall
Created January 3, 2014 22:02
Show Gist options
  • Save RoySegall/8247491 to your computer and use it in GitHub Desktop.
Save RoySegall/8247491 to your computer and use it in GitHub Desktop.
<?php
/**
* Implements hook_menu().
*/
function module_menu() {
$items = array();
$items['foo'] = array(
'page title' => 'Foo',
'page callback' => 'foo',
'access arguments' => TRUE,
);
return $items;
}
/**
* Page callback; This is how you can add css/js in the page callback not matter
* what is returned.
*/
function foo() {
drupal_add_css(drupal_get_path('module', 'module_name') . '/css/module_name.css');
drupal_add_js(drupal_get_path('module', 'module_name') . '/js/module_name.js');
return array(
'whatever'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment