On this page
Caution
The documentation you are viewing is for an older version of this component.
Switch to the latest (v3) version.
View Helpers
FormImage
The FormImage
view helper can be used to render an <input type="image">
HTML form input. It is meant to work with the Image element.
Basic usage
use Laminas\Form\Element;
$element = new Element\Image('my-image');
$element->setAttribute('src', '/img/my-pic.png');
// Within your view...
echo $this->formImage($element);
// Result: <input type="image" name="my-image" src="/img/my-pic.png">