This is a simple application using cakephp to show an example of how to save a HABTM relation while validating the data