for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* User: delboy1978uk
* Date: 19/11/2016
* Time: 21:37
*/
namespace Del\Form\Field;
use Del\Form\Filter\Adapter\FilterAdapterZf;
use Del\Form\Validator\Adapter\ValidatorAdapterZf;
use Zend\Filter\StringTrim;
use Zend\Filter\StripTags;
use Zend\Validator\NotEmpty;
class Text extends FieldAbstract
{
* @return string
public function getTag()
return 'input';
}
public function init()
$this->setAttribute('type', 'text');
$this->setAttribute('class', 'form-control');
$stringTrim = new FilterAdapterZf(new StringTrim());
$stripTags = new FilterAdapterZf(new StripTags());
$notEmpty = new ValidatorAdapterZf(new NotEmpty());
$this->addFilter($stringTrim)
->addFilter($stripTags)
->addValidator($notEmpty);
public function getPlaceholder()
return $this->getAttribute('placeholder');
* @param string $placeholder
public function setPlaceholder($placeholder)
$this->setAttribute('placeholder', $placeholder);