Contents
Who Should Read This Book..........................................................................................................................6
How to Read This Book.............................................................................................................................................6
How to Learn CakePHP..................................................................................................................................7
The Paid Way.............................................................................................................................................................7The Free Way.............................................................................................................................................................8After you’ve done Either/Both Of The Above.........................................................................................................8
Models...............................................................................................................................................................9
Recursion....................................................................................................................................................................9Containable Behavior................................................................................................................................................9Why You Should Use It.............................................................................................................................................9This Will Catch Everyone At Least Once..............................................................................................................10
Custom Find Types........................................................................................................................................11
The Unofficial Cake Way........................................................................................................................................11My Way....................................................................................................................................................................12Comparison..............................................................................................................................................................14App Model................................................................................................................................................................15
Getting the Logged In User from Anywhere...............................................................................................16
The User Model .......................................................................................................................................................16In The AppController..............................................................................................................................................17Back to the User Model...........................................................................................................................................17Usage.........................................................................................................................................................................18What About The Configure Class?........................................................................................................................18Full Source...............................................................................................................................................................19
Automatically Tracking Created/Modified By............................................................................................20
Database...................................................................................................................................................................20Model Relations.......................................................................................................................................................20Model beforeValidate Callback..............................................................................................................................20Behavior beforeValidate Callback.........................................................................................................................20The Full Behavior....................................................................................................................................................21
Routing............................................................................................................................................................22
Case Insensitive........................................................................................................................................................22
Unit Testing....................................................................................................................................................23
Views.........................................................................................................................................................................23
3
Leave a Comment