for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Fiv\Form\Element;
use Fiv\Form\FormData;
/**
*
* @author Ivan Shcherbak <[email protected]>
*/
class Input extends BaseElement {
* @var string
protected $tag = 'input';
* @var array
protected $attributes = [
'type' => 'text',
];
* @return null|string
public function getType() {
return $this->getAttribute('type');
}
* Alias of $this->setAttribute('type' 'text');
* @param string $type
* @return $this
public function setType($type) {
$this->setAttribute('type', strtolower($type));
return $this;
* @param $value
public function setValue($value) {
$this->setAttribute('value', $value);
* @inheritdoc
public function handle(FormData $data) {
$this->setValue($data->get($this->getName()));