Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Diagnostics
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
      • Diagnostics
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • PhpGenerator
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
  • NetteModule
  • 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
  • Nette homepage
 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: use Nette;
11: 
12: 
13: /**
14:  * Submittable image button form control.
15:  *
16:  * @author     David Grudl
17:  */
18: class ImageButton extends SubmitButton
19: {
20: 
21:     /**
22:      * @param  string  URI of the image
23:      * @param  string  alternate text for the image
24:      */
25:     public function __construct($src = NULL, $alt = NULL)
26:     {
27:         parent::__construct();
28:         $this->control->type = 'image';
29:         $this->control->src = $src;
30:         $this->control->alt = $alt;
31:     }
32: 
33: 
34:     /**
35:      * Loads HTTP data.
36:      * @return void
37:      */
38:     public function loadHttpData()
39:     {
40:         parent::loadHttpData();
41:         $this->value = $this->value
42:             ? array((int) array_shift($this->value), (int) array_shift($this->value))
43:             : NULL;
44:     }
45: 
46: 
47:     /**
48:      * Returns HTML name of control.
49:      * @return string
50:      */
51:     public function getHtmlName()
52:     {
53:         return parent::getHtmlName() . '[]';
54:     }
55: 
56: }
57: 
Nette 2.1 API documentation generated by ApiGen 2.8.0