Overview
In this tutorial I will show you the power of associations in cakePHP. With associations you can link up your models and get related data when you fetch results from one model.
In this example I’ll show you how to create an association between a User and a Product.
In this tutorial I’ll be covering
- Explain and create associations between models
- Create an add form for the Products
- Fetch data from one model and get the associated data for free
This part is the follow-up on what we have seen in part 3 of my CakePHP basics serie! At the end I say it’s the last one in the series, but I will do be another one soon about view layouts and elements as I haven’t covered this (rather important) topic yet!
Let me know if you enjoyed it! Happy coding!