Jason Grimes: Using Doctrine 2 in Zend Framework 2
Jason Grimes has posted an article showing how to use Doctrine 2 with Zend Framework 2.
He uses my tutorial as the starting point which enables him to concentrate on the Doctrine integration rather than the irrelevant details about setting a ZF2 application which is excellent.
He walks through 6 steps in order to do the integration:
This article shows how to set up and use Doctrine 2 in Zend Framework 2, by extending Rob’s Getting Started tutorial to use Doctrine instead of Zend_Db.
- Start with Akrabat’s tutorial
- Install Doctrine modules
- Configure the Album module to use Doctrine
- Create the Album entity
- Update the Album controller to use Doctrine instead of Zend_Db
- That’s it!
I highly recommend having a read if you’re at all interested in using Doctrine 2 with Zend Framework 2.
2 thoughts on “Jason Grimes: Using Doctrine 2 in Zend Framework 2”
I tried to follow the tutorial of Jason Grimes and stumbled on a problem with your ZF2 tutorial.
you are using
$basePath = $app->getRequest()->detectBaseUrl();
However since the commit bf18dbd8cad70c1f67477231c97b52165bd5a3cb you need to use:
$basePath = $app->getRequest()->getBaseUrl();
Nonetheless thanks for the tutorial!
Thanks for letting me know Alessio!