I use Yii2 to send a form with one model using this submit button from the view to its controller:
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
Also need to send a boolean variable to the controller when the button is pressed but I don't know how to include it outside of the model.
I can resolve it defining a Html::hiddenInput() but it will include the new hidden field into $model.