12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- /**
- *
- * Cube Framework $Id$ cB9nF4R3PEib5Kll5XE9PmRRR5lKxvF/gdkl7k0wjhI=
- *
- * @link http://codecu.be/framework
- * @copyright Copyright (c) 2014 CodeCube SRL
- * @license http://codecu.be/framework/license Commercial License
- *
- * @version 1.3
- */
- /**
- * button form element generator class
- */
- namespace Cube\Form\Element;
- use Cube\Form\Element;
- class Button extends Element
- {
- /**
- *
- * type of element - override the variable from the parent class
- *
- * @var string
- */
- protected $_element = 'button';
- /**
- *
- * class constructor
- *
- * @param string $name
- */
- public function __construct($name)
- {
- parent::__construct($this->_element, $name);
- }
- /**
- *
- * get translated button value
- *
- * @return string
- */
- public function getValue()
- {
- $value = parent::getValue();
- return $this->getTranslate()->_($value);
- }
- /**
- *
- * render the form element
- *
- * @return string
- */
- public function render()
- {
- $value = $this->getValue();
- return '<button type="' . $this->_type . '" name="' . $this->_name . '" '
- . $this->renderAttributes() . '>'
- . $value
- . '</button>';
- }
- }
|