/Nette/Forms/Controls/Button.php
PHP | 72 lines | 20 code | 16 blank | 36 comment | 0 complexity | d695380c1403863927f48851bcf3fdb6 MD5 | raw file
Possible License(s): BSD-3-Clause
- <?php
- /**
- * Nette Framework
- *
- * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- *
- * This source file is subject to the "Nette license" that is bundled
- * with this package in the file license.txt.
- *
- * For more information please see http://nettephp.com
- *
- * @copyright Copyright (c) 2004, 2009 David Grudl
- * @license http://nettephp.com/license Nette license
- * @link http://nettephp.com
- * @category Nette
- * @package Nette\Forms
- */
- /*namespace Nette\Forms;*/
- require_once dirname(__FILE__) . '/../../Forms/Controls/FormControl.php';
- /**
- * Push button control with no default behavior.
- *
- * @author David Grudl
- * @copyright Copyright (c) 2004, 2009 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 Nette\Web\Html
- */
- public function getControl($caption = NULL)
- {
- $control = parent::getControl();
- $control->value = $this->translate($caption === NULL ? $this->caption : $caption);
- return $control;
- }
- }