PHP Classes

File: src/Field/Hidden.php

Recommend this page to a friend!
  Packages of Derek McLean   HTML Forms   src/Field/Hidden.php   Download  
File: src/Field/Hidden.php
Role: Class source
Content type: text/plain
Description: Class source
Class: HTML Forms
Generate and validate submitted HTML forms
Author: By
Last change:
Date: 8 years ago
Size: 678 bytes
 

 

Contents

Class file image Download
<?php
/**
 * User: delboy1978uk
 * Date: 19/11/2016
 * Time: 21:37
 */

namespace Del\Form\Field;

use Del\Form\Filter\Adapter\FilterAdapterZf;
use Zend\Filter\StringTrim;
use Zend\Filter\StripTags;

class Hidden extends FieldAbstract
{
    /**
     * @return string
     */
    public function getTag()
    {
        return 'input';
    }


    public function init()
    {
        $this->setAttribute('type', 'hidden');
        $this->setAttribute('class', 'form-control');
        $stringTrim = new FilterAdapterZf(new StringTrim());
        $stripTags = new FilterAdapterZf(new StripTags());
        $this->addFilter($stringTrim)
            ->addFilter($stripTags);
    }
}