How to set a value in textarea Yii2 activeform from a variable?
<p>I have the following code, how to set a value from a variable in the textarea? Thanks.</p>

<pre><code>&lt;?php

$connection = \Yii::$app-&gt;db;

$sql = 'SELECT user_profile_name FROM users_profiles WHERE user_id = :_id';
$command = $connection-&gt;createCommand($sql);
$command-&gt;bindParam(':_id',$userId);
$username = $command-&gt;queryScalar();
$command-&gt;execute();
?&gt;

&lt;?=  $form-&gt;field($model, 'name')
        -&gt;textInput(['editable' =&gt; true,'value' =&gt; $username]) ?&gt;
</code></pre>