Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. public function actionShowImagesByCategory($id) //to jest przekazywane ID kategorii
  2. {
  3.     //nie wiem czy dokladnie tak wyglada pobieranie danych w yii2, no ale pewnie cos w tym stylu
  4.     $images = Image::findAll(['categoryId'=>$id]); //tu juz masz wszystkie obrazki z danej kategorii
  5.  
  6.     //renderujesz, przekazujesz do widoku zmienna images
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement