You are here

public static function TextimageImager::getImageUrl in Textimage 7.3

Get a Textimage URL, building the image if necessary.

Parameters

name $style_name: the image style name.

array $effects_outline: an outline of the style's effects data.

array $text: text to be used to deliver the image.

string $extension: (optional) file extension to be delivered (png jpg jpeg gif). Defaults to 'png'.

bool $caching: (optional) TRUE if image caching has to be used. Defaults to TRUE.

object $node: (optional) a node entity. It is used for resolving the tokens in the text effects.

object $source_image_file: (optional) a file entity. It is used for resolving the tokens in the text effects.

string $target_uri: (optional) defines the URI where the Textimage image file should be saved. Disables caching.

Return value

array the URL of the image, or NULL in case of failure

2 calls to TextimageImager::getImageUrl()
TextimageFieldFormatterTest::testTextimageFieldFormatter in tests/textimage.test
Test Textimage formatter on node display.
TextimageFieldFormatterTest::testTextimageMultiValueFieldFormatter in tests/textimage.test
Test Textimage formatter on multi-value text fields.

File

classes/TextimageImager.inc, line 39
Textimage - Image processor class.

Class

TextimageImager
Textimage - Image processor class.

Code

public static function getImageUrl($style_name, $effects_outline, $text, $extension = 'png', $caching = TRUE, $node = NULL, $source_image_file = NULL, $target_uri = NULL) {
  $data = array(
    'style_name' => $style_name,
    'effects' => $effects_outline,
    'text' => $text,
    'target_uri' => $target_uri,
    'extension' => $extension,
    'caching' => $caching,
    'node' => $node,
    'source_image_file' => $source_image_file,
  );
  return self::getTextimage($data)
    ->getUrl();
}