在CakePHP中,是否可以设置全局传递给Form helper create方法的选项?
因为我想在我的所有表单上使用特定的表单布局,所以当我创建每个表单时,我当前必须这样做.
<?php
echo $this->Form->create('User', array(
'class' => 'form-horizontal',
'inputDefaults' => array(
'format' => array('before', 'label', 'between', 'input', 'error', 'after'),
'between' => '<div class="controls">',
'after' => '</div>',
'div' => 'control-group',
'error' => array(
'attributes' => array('wrap' => 'span', 'class' => 'help-inline')
)
)
));
?>
Run Code Online (Sandbox Code Playgroud)
我想知道是否有一种方法来指定全局,所以我不需要每次创建调用都这样做.