forked from netsensei/cats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcats.module
49 lines (40 loc) · 790 Bytes
/
cats.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* @file
* My cool cats Angular App module
*/
/**
* Implements hook_menu().
*/
function cats_menu() {
$items['cats'] = array(
'title' => 'All cats',
'page callback' => 'cats_page',
'access arguments' => array('access content'),
);
return $items;
}
/**
* Implements hook_theme().
*/
function cats_theme() {
return array(
'all_cats' => array(
'template' => 'all-cats',
),
);
}
/**
* Cats page callback
*/
function cats_page() {
// Set the path
$path = drupal_get_path('module', 'cats');
// Load angular
drupal_add_library('angularjs', 'angularjs');
// Load the app
drupal_add_js($path . '/js/cats.gen.js');
drupal_add_css($path . '/css/bootstrap.css');
// Return the HTML template
return theme('all_cats');
}