Reputation: 784
code is here
<?= $form->field($model, 'machine_name') ?>
and it will gives
<input type="text" id="machine-machine_name" class="form-control" name="Machine[machine_name]" maxlength="255" aria-required="true" autocomplete="off">
and i want to change
name="Machine[machine_name]"
to
name="something_else[machine_name]"
something_else is dymanic for all form fields
Upvotes: 0
Views: 1638
Reputation: 22174
This prefix comes from formName()
. You can override this method in your model (Machine
) to provide custom prefix:
public function formName() {
return 'something_else';
}
Upvotes: 5