/www/libs/nette-dev/Forms/Controls/Button.php
PHP | 58 lines | 19 code | 12 blank | 27 comment | 0 complexity | f4c3201c819bc3e0b2d6d163f334e282 MD5 | raw file
Possible License(s): BSD-3-Clause, MIT
- <?php
- /**
- * Nette Framework
- *
- * @copyright Copyright (c) 2004, 2010 David Grudl
- * @license http://nettephp.com/license Nette license
- * @link http://nettephp.com
- * @category Nette
- * @package Nette\Forms
- */
- /**
- * Push button control with no default behavior.
- *
- * @copyright Copyright (c) 2004, 2010 David Grudl
- * @package Nette\Forms
- */
- class Button extends FormControl
- {
- /**
- * @param string caption
- */
- public function __construct($caption = NULL)
- {
- parent::__construct($caption);
- $this->control->type = 'button';
- }
- /**
- * Bypasses label generation.
- * @return void
- */
- public function getLabel($caption = NULL)
- {
- return NULL;
- }
- /**
- * Generates control's HTML element.
- * @param string
- * @return Html
- */
- public function getControl($caption = NULL)
- {
- $control = parent::getControl();
- $control->value = $this->translate($caption === NULL ? $this->caption : $caption);
- return $control;
- }
- }