for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Fiv\Form\Element;
/**
* @author Ivan Shcherbak <[email protected]> 7/11/14
*/
class Input extends Base {
protected $tag = 'input';
protected $type = 'text';
* @return string
public function getType() {
if (empty($this->attributes['type'])) {
$this->attributes['type'] = $this->type;
}
return $this->attributes['type'];
* @param string $type
* @return $this
public function setType($type) {
$this->attributes['type'] = $type;
return $this;
* @param $value
public function setValue($value) {
parent::setValue($value);
$this->setAttribute('value', $this->value);
*
public function render() {
$this->setAttribute('type', $this->getType());
return parent::render();