my view
ID Name Role requested </tr>
</thead>
<tbody>
<?php if($count > 0):?>
<?php foreach ($models as $model): ?>
<tr>
<th scope="row"><?php echo $model->ID; ?></th>
<td><?php echo $model->PFNO; ?></td>
<td><?php echo $model->RO_NAME; ?></td>
</tr>
<?php endforeach;?>
<?php else: ?>
<tr>
<td>No role requested</td>
</tr>
<?php endif; ?>
my controller
public function actionTrack()
{
$user = Yii::$app->user->identity;
$PFNO = $user->PFNO;
$models = Usarequest::find()->where(['PFNO'=>$PFNO])->all();
$count = count($models);
return $this->render('track',[
'model'=>$models,
'count'=>$count
]);
}