Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function actionShowImagesByCategory($id) //to jest przekazywane ID kategorii
- {
- //nie wiem czy dokladnie tak wyglada pobieranie danych w yii2, no ale pewnie cos w tym stylu
- $images = Image::findAll(['categoryId'=>$id]); //tu juz masz wszystkie obrazki z danej kategorii
- //renderujesz, przekazujesz do widoku zmienna images
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement