Skip to content

disassembler/Drupal-MVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An MVC framework for Drupal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages