开发者

Codeigniter HMVC and datamapper compatibility

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.exitecm开发者_JS百科s.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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜