문제

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

도움이 되었습니까?

해결책

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');

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top