I’m very happy to announce the release today of more bonus material for Yii 2 For beginners. In this release, we implement a one-click Facebook login and registration thanks to Yii2’s authclient extension.
All updates and bonus material are free to anyone who purchases the book, just log in to your leanpub.com account and pull down the latest version.
The Social Auth implementation is a great feature and you will want to add it to your template. We did a fairly robust implementation of this which I think you will enjoy. We cover it step by step, so you will definitely understand it from one end to the other.
With this release, we also refactored the helper methods and some of the relationships. We had some requests and feedback from programmers who wanted me to use a more conventional approach for the relationship between user and role.
The code worked perfectly fine as it was, but it had room for improvement. So, after consulting with a number of programmers, I decided it was in the best interest of the template we are building to do the refactor. It makes the code cleaner, more extensible, easier to maintain, and more closely follows best practices.
Obviously there are many programmers still working their way through the book, including the ones who have purchased today before the release, so I accounted for that by including a migration guide in chapter 15.
Anyone who wants to update the template to the new version can do so easily with the migration guide. I highly recommend updating because it will allow you to take advantage of future updates.
I provide all the updated files via Gists, so this is actually easy to implement. Everything is referenced from chapter 15, so you can just zip down list and get it done fast.
If you are still working your way through the book, the major changes begin in chapter 5, so you can use that as a reference point. I’ve actually added new material as well in chapter 6, so we learn more about Active Record in the process. It makes doing the change worthwhile because you can see how much better this implementation really is.
If you have any questions about what’s changed, consult chapter 15. It’s very easy to follow.
With all the new material, this is more like a second edition of the book. I’m happy to maintain this level of commitment to readers and to the template to make it the best it can be. This book is an ongoing project with more material coming.
Special thanks to everyone who wrote ratings and reviews on GoodReads.com, and to those who wrote in to report typos and bugs, it really makes a huge difference in the reading experience and everyone appreciates it. Thanks again for sharing the Yii 2 journey with me.