3

I am new to Codeigniter and I am thinking about the use of this framework in my new project. I am going to need these two extensions. Before digging into too deep, I wonder if anyone already has experience with them and can kindly give some insights on whether there is any compatibility issue when they are used together.

Modular Extensions - HMVC
http://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home
Datamapper ORM
http://datamapper.exitecms.org/

I believe there are many others who are going to use these two extensions together because they are actually very popular ones. So, many people are going to benefit from this thread.

Many many thanks to you all.

tereško
  • 58,060
  • 25
  • 98
  • 150
bobo
  • 8,439
  • 11
  • 57
  • 81

2 Answers2

1

Firstly a caveat : I have used the HMVC extension but not the Datamapper ORM.

As far as I see it the two extensions have separate goals. In principle I cannot see a conflict.

The HMVC extension is useful where your view is composed of multiple sub-views. It allows you to modularise your application so that your views can be built from the output of multiple controller actions.

The Datamapper ORM allows you to map the data in your database directly onto PHP objects in your application. It saves you the cruft of writing SQL queries to pull rows from a database and hydrate objects in your application. You define what table your model is loaded from and how it is related to the other models in your application. The Datamapper generates the queries to perform the CRUD operations behind the scenes.

HMVC is concerned with how you structure your application. The Datamapper ORM is concerned with how you build your models. I don't see how the Datamapper would stop you using HMVC or vice-versa.

Stephen Curran
  • 7,433
  • 2
  • 31
  • 22
  • Thanks so much for your reply. The reason why I am anticipating some compatibility issues when they are used together is I have found this web page: http://codeigniter.com/wiki/HMVC_for_DMZ_Modular_Separation/ this seems to be another extension written by somebody which is also for the purpose of doing HMVC in Codeigniter and it does have some issues with the datamapper (though it's the previous version) – bobo Dec 07 '10 at 17:05
  • Ah - I see what you mean. When autoloading the model in the module, the module's models directory isn't being searched. When using HMVC I always defined my models at the application level and then shared them across all my modules. Do you plan to define your models at the application or module level (or a combination of both)? – Stephen Curran Dec 07 '10 at 17:28
  • I know - By defining the model on the application level rather than the module level it means the module isn't portable to other applications. But I never really found the portability of modules that useful. I only used HMVC to decompose a view into multiple subviews each with its own controller action. – Stephen Curran Dec 07 '10 at 17:43
1

I'd also suggest taking a look at Doctrine ORM. It's a very powerful ORM framework that I've been using for the past year or so in all my CodeIgniter projects and works really well without any compatibility issues or such.

Tutorial for installing Doctrine with CodeIgniter.

Shivaas
  • 694
  • 3
  • 12
  • Thanks a lot for your reply. May I ask if you used Modular Extensions - HMVC with Doctrine ORM without any compatibility issues in your projects before? – bobo Dec 10 '10 at 15:50
  • I haven't used HMVC with Doctrine in my projects. – Shivaas Dec 10 '10 at 20:14