3.6. Function reference
3.6.16. isImage()
3.6.15. indent()
« Previous
3.6.17. isUrl()
Next »

3.6.16. isImage()

Referenceboolean isImage(string $text)

Returns true, if the $text is a valid URL/path to the image file. The function checks it by the file extension. Currently recognized ones are:

  1. JPG
  2. PNG
  3. BMP
  4. GIF
  5. SVG

Sample use:

<!-- displays the IMG tag, if the `$text` contains a path to the image -->
<img parse:src="$text" opt:if="isImage($text)" />
3.6.16. isImage()
3.6. Function reference
« Previous
3.6.15. indent()
Next »
3.6.17. isUrl()