Hide/read-only a input that is not on a model scenario

Hey community,

What is the most clean way on yii2 to make hide/read-only my input if that property is not on my scenario ?


// my scenario model

return [

            'user-create' => ['username'],

            'admin-create' => ['username', 'email']


// My _form.php

    <div class="row">

        <div class="col-sm-6">

            <?= $form->field($user, 'username') ?>


        <div class="col-sm-6">

            <?= $form->field($user, 'email') ?>



So in this case i wanna wide email for the user-create.

Important notes: I want to do this without create a specific _form for another scenario , and without make dirty code.