-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
36 lines (31 loc) · 956 Bytes
/
README
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
To use this module:
git clone git://github.com/disassembler/Drupal-MVC.git <drupal_dir>/sites/<yoursite>/modules/mvc
Enable mvc module in drupal
add a hook to your current module you want to add mvc functionality for like so:
{{{
/**
* Implements hook_mvc_app()
*/
function module_mvc_app() {
$mvc = new ArrayObject();
$mvc['base'] = 'base';
$mvc['path'] = drupal_get_path('module','README');
$mvc['blocks'] = array(array(
'name' => 'myblock',
'title' => 'Block Title',
'controller' => 'controller',
'method' => 'method',
'args' => array('arg1','arg2'),
));
$mvc['menu_items'] = array(array(
'path' => 'menu/path',
'title' => 'My Menu Item',
'controller' => 'controller',
'method' => 'method',
'args' => array('arg1'),
));
return $mvc;
}
}}}
Create directories for controller, models and views
To see an example of how this works, a HelloController with it's view exist in the module itself