Question

Probably been asked before, but I cant find it on here :)

Im using the inbuilt Scaffolding in Cake 1.3, and dont really want to start messing with views yet, happy to let the automatic form creation (based on models) control the view for now. My question is, if I want to add a checkbox to the form, what datatype do I need to use in the model, so that the checkbox will appear on the form automatically (if I can do that at all?).

Thanks Stephen

Was it helpful?

Solution

You want to set the datatype in the database to TINYINT(1). CakePHP will then automatically use a checkbox in the form with $this->Form->input('fieldName');

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top