Created
April 10, 2015 19:27
-
-
Save davidimoore/7df63fc65589a83c9217 to your computer and use it in GitHub Desktop.
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
function obj_present($resource, $value){ | |
if(isset($resource[$value]) || $resource[$value] != '0'){ | |
return $resource[$value]; | |
} | |
} | |
function image_tag($image_data) { | |
echo "<img src='" . img::getImg($image_data, 1) . "'>"; | |
} | |
static function getResourceImage($resource) { | |
if(obj_present($resource, 'image1')){ | |
image_tag($resource['image1']); | |
}elseif(obj_present($resource, 'image2')){ | |
image_tag($resource['image2']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment