与文档根据CakePHP的3 - 创建hiddenField
http://book.cakephp.org/3.0/en/views/helpers/form.html#options-for-select-checkbox-and-radio-inputs
我用 “HiddenField” 创建值为0隐藏输入喜欢这张
echo $this->Form->Label("Stats ");
echo $this->Form->checkbox('stats', [
'value' => '1',
'hiddenField' => '0',
]);
我的HTML(有没有隐藏领域),因为它应该:
<input type="checkbox" name="stats" value="1" required="required">
我昨天做了,但今天它' s没有工作,我还没有更新蛋糕版。没什么,Crazy:\
没错,但我认为“array()”是cakephp 2.x的sintax!那么Thx ^^ – TMoraes 2015-02-06 23:07:40