我使用以下代码在我的 yii2 应用程序中创建了活动表单
$form = ActiveForm::begin([
'id' => 'deposit-form',
'enableClientValidation' => true,
'fieldConfig' => [
'template' => '{input}{error}',
'options' => [
'tag' => false
]
],
'action' => 'create',
'options' => [
'class' => 'form-horizontal',
'method' => 'post',
]
])
但是我的表单没有显示任何方法,即获取或发布。我的表格的输出是
<form role="form" class="form-horizontal">
我不想这样<form role="form" class="form-horizontal" method="POST">
如何达到以下结果我也试过这段代码
$form = ActiveForm::begin([
'id' => 'deposit-form',
'enableClientValidation' => true,
'fieldConfig' => [
'template' => '{input}{error}',
'options' => [
'tag' => false
]
],
'action' => 'create',
'method' => 'post',
'options' => [
'class' => 'form-horizontal',
]
])