Answer the question
In order to leave comments, you need to log in
How to display not all database records in Yii2?
With the help of gii (Yii2) I made a model and a form for changing, viewing, deleting records from the database. So, it outputs all entries, how do I make it output entries if the field is author_id=Yii::$app->user->identity['id'] ?
Answer the question
In order to leave comments, you need to log in
add a condition to the selection, ala:
$query = Products::find()->where([
'author_id' => Yii::$app->user->identity['id']
])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question