Backend\Core\Engine\Form::addImage PHP Method

addImage() public method

Adds a single image field.
public addImage ( string $name, string $class = null, string $classError = null ) : FormImage
$name string The name of the element.
$class string Class(es) that will be applied on the element.
$classError string Class(es) that will be applied on the element when an error occurs.
return FormImage
    public function addImage($name, $class = null, $classError = null)
    {
        $name = (string) $name;
        $class = $class !== null ? (string) $class : 'fork-form-image';
        $classError = $classError !== null ? (string) $classError : 'error';
        // add element
        $this->add(new FormImage($name, $class, $classError));
        return $this->getField($name);
    }