Method showImage()

public function showImage() {
    
    //...your PHP code...//
}

Summary

Allows you to generate an image for download or for display using your module.

Context

No context is provided automatically. You must provide any context yourself in the GET request.

Where You Can Use It

From Zenario 7.0.0 onwards.

Description

You should write a showImage() method if you want your Plugin to generate images.

You should send appropriate headers, then output the contents of the file.

Return Value

No return value is needed.

Example

public function showImage() {
    header('Content-Type: image/jpeg');
    readfile("myimage.jpg");
}

This offers a file called myimage.jpg for download. (Note that this is just a simple example; you would probably want to store images in a database table to make showFile useful.