Elements

In This Article

Image

Zend\Form\Element\Image represents a image button form input. It can be used with the FormImage view helper.

Basic Usage

This element automatically adds a type attribute of value image.

use Zend\Form\Element;
use Zend\Form\Form;

$image = new Element\Image('my-image');
$image->setAttribute('src', 'http://my.image.url'); // Src attribute is required

$form = new Form('my-form');
$form->add($image);

Found a mistake or want to contribute to the documentation? Edit this page on GitHub!