public function actionPreviousphoto($photo_id) { $photo = \app\modules\photo\models\Photos::findPrevious($photo_id); $array = $photo->attributes; Yii::$app->response->format = 'json'; return $array; }
public function findListOfPhotos() { return Photos::find()->where('album_id=:album_id AND is_deleted = 0', [':album_id' => $this->id]); }
private function getPhoto($id, $resolution) { $photo = \app\modules\photo\models\Photos::findOne($id); $photo->createAlbumPath($this->module->params['uploadsPath']); return (new \app\modules\photo\components\Image($photo, $resolution))->get()->render(); }