Last active
November 4, 2023 09:43
-
-
Save tguruslan/80a3c257b4a3068125fbf07dba38e7af to your computer and use it in GitHub Desktop.
get full image url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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