You are here

function fft_field_styled_image_url in Field Formatter Template 7

Same name and namespace in other branches
  1. 8.2 fft.module \fft_field_styled_image_url()
  2. 8 fft.module \fft_field_styled_image_url()

Get image url with then style name.

Parameters

string $image_uri: Image uri.

string $style: Image style name.

Return value

string Return image url.

1 call to fft_field_styled_image_url()
fft_field_formatter_view in ./fft.module
Implements hook_field_formatter_view().

File

./fft.module, line 362
Field formatter template.

Code

function fft_field_styled_image_url($image_uri, $style) {
  $image_filepath = image_style_path($style, $image_uri);
  if (!file_exists($image_filepath)) {
    image_style_create_derivative(image_style_load($style), $image_uri, $image_filepath);
  }
  return file_create_url($image_filepath);
}