CodeIgniter and Doctrine from Scratch
When starting my last project a few months ago, I toyed with the idea of combining CodeIgniter with anĀ ORM to put a spin on things and see how much I enjoyed the extra layer of efficiency. In my quest to find the perfect match, I stumbled across this set of tutorials which demonstrates (very well) how to use Doctrine with CodeIgniter.
Doctrine is (as they describe it on the website):
Doctrine is a PHP ORM (object relational mapper) for PHP 5.2.3+ that sits on top of a powerful PHP DBAL (database abstraction layer). One of its key features is the ability to optionally write database queries in an OO (object oriented) SQL-dialect called DQL inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains a maximum of flexibility without requiring needless code duplication.
The tutorial walks you step-by-step through the process of integrating Doctrine with CodeIgniter and then dives even deeper into topics such as model relationships, hooks, profiling, DQL, templates, and data hydrators. Overall, it’s a very thorough tutorial.
- Day 1: Install and Setup
- Day 2: The Basics
- Day 3: User Signup Form
- Day 4: User Login
- Day 5: Database CRUD
- Day 6: Models with Relationships
- Day 7: Fixtures & Forum List
- Day 8: Hooks, Profiling & DQL
- Day 9: Templates & Data Hydrators
- Day 10: …coming soon
FYI – In the end I decided against using Doctrine in my project, as it added a bit too much weight and required that I mess with yet another layer. But you stand to lose nothing going through these tutorials, you will learn a lot even if you decide against Doctrine in the end.
Tagged as CodeIgniter, Doctrine, tutorials + Categorized as CodeIgniter