public function actionFriend($id) { $this->layout = '//u'; $model = $this->findModel($id); \Yii::$app->view->params['model'] = $model; $friends = Friend::getFriendsByUid($id); return $this->render('friends', ['friends' => $friends, 'model' => $model]); }
/** * Lists all models. */ public function actionIndex() { $friends = Friend::getFriendsByUid(\Yii::$app->user->id); return $this->render('index', array('friends' => $friends)); }