Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • BaseControl
  • Button
  • Checkbox
  • CheckboxList
  • ChoiceControl
  • CsrfProtection
  • HiddenField
  • ImageButton
  • MultiChoiceControl
  • MultiSelectBox
  • RadioList
  • SelectBox
  • SubmitButton
  • TextArea
  • TextBase
  • TextInput
  • UploadControl
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (https://nette.org)
 5:  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Forms\Controls;
 9: 
10: 
11: /**
12:  * Submittable image button form control.
13:  */
14: class ImageButton extends SubmitButton
15: {
16: 
17:     /**
18:      * @param  string  URI of the image
19:      * @param  string  alternate text for the image
20:      */
21:     public function __construct($src = null, $alt = null)
22:     {
23:         parent::__construct();
24:         $this->control->type = 'image';
25:         $this->control->src = $src;
26:         $this->control->alt = $alt;
27:     }
28: 
29: 
30:     /**
31:      * Loads HTTP data.
32:      * @return void
33:      */
34:     public function loadHttpData()
35:     {
36:         parent::loadHttpData();
37:         $this->value = $this->value
38:             ? [(int) array_shift($this->value), (int) array_shift($this->value)]
39:             : null;
40:     }
41: 
42: 
43:     /**
44:      * Returns HTML name of control.
45:      * @return string
46:      */
47:     public function getHtmlName()
48:     {
49:         return parent::getHtmlName() . '[]';
50:     }
51: }
52: 
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0