Exemplo n.º 1
0
 /**
  * Displays a single User model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     $comment = new ActiveDataProvider(['query' => CommentModel::find()->where(['createdBy' => $id])]);
     $commentCount = CommentModel::find()->where(['createdBy' => $id])->count();
     $assignmentUser = AuthAssignment::findOne(['user_id' => $id]);
     return $this->render('view', ['model' => $this->findModel($id), 'profile' => $this->findModelProfile($id), 'role' => $assignmentUser, 'dataProvider' => $comment, 'commentCount' => $commentCount]);
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAuthAssignments()
 {
     return $this->hasMany(AuthAssignment::className(), ['item_name' => 'name']);
 }