How to hide a set of fileds from the model


so I’m trying to use the same Model to render similar forms: the difference between them is very little and I would like to hide or show a field based, for example, on the scenario. Is this possible?



You could do something like

<?php if ($model->scenario != 'scenarioWithHiddenFields'):?>

  ... fields that would be hidden

<?php endif;?>

thank you, that did it! I was not aware that you could ask for the scenario from the view.