Getting started with Doctrine 2 and CodeIgniter
I've been reading about Doctrine for a while now and it surely looks interesting.
I have read through most of the tutorials on phpandstuff.c开发者_如何学JAVAom, but I realise they're way outdated at the moment. However, those tutorials did really show the usefulness of Doctrine.
I am now looking for advice on how to get started with Doctrine, preferably in combination with CodeIgniter. I know my way around CI, so I'd prefer to integrate with that framework.
It was fairly hard to find a decent guide on integrating Doctrine 2.1 with CI 2.0.x, but after following this guide, I seem to have succeeded at it. I now have a working CI install with integrated Doctrine.
I suppose the best advice anyone could give me is to RTFM. However, I'd like some more in-depth advice, if possible.
Should I go through the Doctrine tutorials/examples first without CI and then make my way back to the CI install, or would it be possible to try and work through the tutorials while using my new CI installation?
Does anyone know of any decent guides/books/blogs on getting started with Doctrine? Preferably something like the phpandstuff.com tutorials, but up to date. Or, for those having read those tutorials, are they still applicable to Doctrine/CI 2+?
I'm looking for a starting point here as there's a lot of information to be found, but it seems like there's also a lot of outdated information out there. I'll be working through the Doctrine documentation asap, but I'm interested in any other guides/tutorials/books/etc. I can find.
Thanks a lot in advance.
I'll start off by saying that no, I don't know of any decent guides for getting started on Doctrine. If you understand how to use PHP as an object-oriented language (classes, inheritance, namespaces, etc) then you should have no trouble learning Doctrine 2 because it has been designed in such a way that you are simply creating and accessing regular PHP classes. You are absolutely right - reading the documentation is (in my opinion) the best place to start with Doctrine.
You could start by creating simple a simple system like a blog; this should help you get to grips with how Doctrine handles associations and give you a chance to use the command line utility. When you feel like you need more functionality or you're stuck on something, the documentation will almost always be enough to help you out and if not, SO has thousands of Doctrine-related questions & answers.
Just remember, Doctrine 2 is not supposed to be complicated. It is supposed to be a transparent layer that lets you access your database as PHP classes.
精彩评论