我有这个在我看来CakePHP表单输入 - 防止默认?
<?=$this->Form->create('Company')?>
<?=$this->Form->input('Company.company_category_id')?>
<?=$this->Form->input('Company.county')?>
<?=$this->Form->input('Company.name')?>
// Here i intend to insert all model fields in order to export them
<?=$this->Form->input('ExportField.company_category_id', array('label' => 'Categorie', 'type' => 'checkbox', 'options' => null))?>
// ...
<?=$this->Form->end('Submit')?>
我的问题是,助手是“自动地”认为ExportField。{}场为形式的主力机型领域(公司在这种情况下)。
我可以使用解决方法来解决这个问题,但我想知道如果我可以强制它维持这种方法。
谢谢!
你是什么意思的'形式的主要模型领域'? –
作为第一个参数传递给create方法的那个。 – Michael
这应该可以正常工作。发布它生成的HTML代码? – Dave