public static function getPostAttachmentPhoto($filename) { $data = Photo::find()->where(['filename' => $filename])->andWhere(['type' => 'postPhoto'])->one(); if (!is_null($data)) { $imgLocClass = "common\\components\\ImgLocations\\" . $data['image_loc']; $img = new Image($data['filename'], ImageTypes::PostPhoto(), new $imgLocClass()); return $img->getImage(); } else { return null; } }
public function actionMyfriends() { $id = Yii::$app->user->getId(); $uid = new components\UserId($id); /////// $friends = RelationService::getFriendsList($uid); $falone = new components\Image("forever_alone.png", new components\ImageTypes(components\ImageTypes::InTouchImage), new components\ImgLocations\ImgIntouch()); $faloneT = new components\Image("forever_alone_text.png", new components\ImageTypes(components\ImageTypes::InTouchImage), new components\ImgLocations\ImgIntouch()); /////// return $this->render('myFriends', ['friends' => $friends, 'imgForeverAlone' => $falone->getImage(), 'imgForeverAloneText' => $faloneT->getImage()]); }