PHP Classes
elePHPant
Icontem

File: src/Traits/HasOptionsTrait.php

Recommend this page to a friend!
  Classes of Derek McLean  >  HTML Forms  >  src/Traits/HasOptionsTrait.php  >  Download  
File: src/Traits/HasOptionsTrait.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: 1 year ago
Size: 817 bytes
 

 

Contents

Class file image Download
<?php
/**
 * Created by PhpStorm.
 * User: DM0C60544
 * Date: 15/12/2016
 * Time: 10:41 AM
 */

namespace Del\Form\Traits;


trait
HasOptionsTrait
{
   
/** @var array $options */
   
private $options = [];

   
/**
     * @return array
     */
   
public function getOptions()
    {
        return
$this->options;
    }

   
/**
     * @param array $options
     * @return $this
     */
   
public function setOptions($options)
    {
       
$this->options = $options;
        return
$this;
    }

   
/**
     * @return array
     */
   
public function getOption($key)
    {
        return
$this->options[$key];
    }

   
/**
     * @param $key
     * @param $value
     * @return $this
     */
   
public function setOption($key, $value)
    {
       
$this->options[$key] = $value;
        return
$this;
    }
}