Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Form / View / Helper / FormImage.php
blob8e6f6e4f84f9766fd0ae9336acf4a175ef36f975
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Form\View\Helper;
12 use Zend\Form\ElementInterface;
13 use Zend\Form\Exception;
15 class FormImage extends FormInput
17 /**
18 * Attributes valid for the input tag type="image"
20 * @var array
22 protected $validTagAttributes = array(
23 'name' => true,
24 'alt' => true,
25 'autofocus' => true,
26 'disabled' => true,
27 'form' => true,
28 'formaction' => true,
29 'formenctype' => true,
30 'formmethod' => true,
31 'formnovalidate' => true,
32 'formtarget' => true,
33 'height' => true,
34 'src' => true,
35 'type' => true,
36 'width' => true,
39 /**
40 * Render a form <input> element from the provided $element
42 * @param ElementInterface $element
43 * @throws Exception\DomainException
44 * @return string
46 public function render(ElementInterface $element)
48 $src = $element->getAttribute('src');
49 if (empty($src)) {
50 throw new Exception\DomainException(sprintf(
51 '%s requires that the element has an assigned src; none discovered',
52 __METHOD__
53 ));
56 return parent::render($element);
59 /**
60 * Determine input type to use
62 * @param ElementInterface $element
63 * @return string
65 protected function getType(ElementInterface $element)
67 return 'image';