Optional belongsTo relationship in cakephp

Darkgardevoir

New Member
I have a simple Category model in my CakePHP application. I want to add sub-categories, and do this by simply adding a parent_id column.The parent_id is a belongsTo relationship, that references back to the same Category model.When I generate my admin scaffolds, a dropdown will shop up (correct!), but I'd like to include a NULL option in this dropdown (for top-level categories).Is this possible? And if so, how.. (Note: not interested in Tree behaviour right now)
 
Back
Top