Show multiple values for a field in gridview
<p>i am new in yii2. I have a <code>languages</code> master table (in <code>name</code> field contains html,css, java,php...) and a <code>registration</code> table in which there is a field called <code>language_id</code>. I have inserted multiple values for that field using json_encode.
Now in database showing language id's as <code>["1","2","3","4","5"]</code></p>

<p>Now i want to display the data stored in db using a gridview. How can i show the multiple values for languages in gridview. Given below is what i have tried with my <strong>gridview</strong></p>

<pre><code>&lt;?= GridView::widget([
        'dataProvider' =&gt; $dataProvider,
        'filterModel' =&gt; $searchModel,
        'columns' =&gt; [
            ['class' =&gt; 'yii\grid\SerialColumn'],

            'first_name',
            'last_name',
            'gender',
            'address',
            ['label'=&gt;'Course',
            'value'=&gt;'course.name'],
            'email:email',
            ['label'=&gt;'Languages Known',
            'value'=&gt;'languages.name'],
            'course_completion_date',

            ['class' =&gt; 'yii\grid\ActionColumn'],
        ],
    ]); ?&gt;
</code></pre>

<p>and in my <strong>Model</strong> code is as follows</p>

<pre><code>public function getLanguages(){

        $result = json_decode($this-&gt;language_id, true);

        return $this-&gt;hasOne(Languages::className(), ['id' =&gt; $result]);
    }
</code></pre>