Skip to content

Instantly share code, notes, and snippets.

@tguruslan
Last active November 4, 2023 09:43
Show Gist options
  • Save tguruslan/80a3c257b4a3068125fbf07dba38e7af to your computer and use it in GitHub Desktop.
Save tguruslan/80a3c257b4a3068125fbf07dba38e7af to your computer and use it in GitHub Desktop.
get full image url
<?php
use noam148\imagemanager\models\ImageManager;
/**
* Get the path for the given ImageManager_id record
* @param int $ImageManager_id ImageManager record for which the path needs to be generated
* @return null|string Full path is returned when image is found, null if no image could be found
*/
public static function getOriginalImagePath($ImageManager_id) {
$return = null;
$model = ImageManager::findOne($ImageManager_id);
$return = \Yii::$app->imagemanager->getImagePath($model->id, $model->imageDetails['width'], $model->imageDetails['height'], "inset");
return $return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment