Sets the interface and api labels and messages.

@param  string|array $attr
@param  array $value

@return self
762341
public function setInterfaceTrans($attr, $value = null)
    {
        if (is_array($attr))
            $this->interfaceTrans = array_merge($this->interfaceTrans, $attr);
        else
            $this->interfaceTrans[$attr] = $value;

        return $this;
    }
361097
public function setMessageAttribute($value)
    {
        $this->attributes['message'] = trim(str_replace("&nbsp;", ' ', strip_tags((isset($value['text'])) ? $value['text'] : (! is_array($value) ? $value : ''))));
    }
1324899
public function setAttr($attribute, $value = null)
    {
        if (is_array($attribute) && is_null($value)) {
            foreach ($attribute as $k => $v) {
                $this->setAttr($k, $v);
            }

            return $this;
        }
        $this->template->appendHTML('attributes', ' '.$attribute.'="'.$value.'"');

        return $this;
    }
459551
public function setAttribute(string $attribute, $value = []): self
    {
        $this->attributes[$attribute] = $this->wrap($value);

        return $this;
    }
702480
static function text($name, $value, $attr = array())
    {
        $attr = array_merge(
            array(
                "type" => "text"
            ),
            $attr
        );

        self::input($name, $value, $attr);
    }
272726
public function setAttribute($attribute, $value = null)
    {
        if (is_array($attribute)) {
            $this->attributes = array_merge_recursive($this->attributes, $attribute);

            return $this;
        }

        if (is_array($value)) {
            $old = $this->attributes[$attribute] ?? [];
            $this->attributes[$attribute] = array_merge((array) $old, $value);
        } else {
            $this->attributes[$attribute] = $value;
        }

        return $this;
    }
343817
public M setOrPut(String attrOrNot, Object value) {
		Table table = _getTable();
		if (table != null && table.hasColumnLabel(attrOrNot)) {
			_getModifyFlag().add(attrOrNot);	// Add modify flag, update() need this flag.
		}
		
		attrs.put(attrOrNot, value);
		return (M)this;
	}
717857
public function addAttr($attr, $value = '')
    {
        if (func_num_args() > 1) {
            $this->optionAttr[$attr] = $value;
        } elseif (is_array($attr)) {
            $this->optionAttr = $attr;
        }

        return $this;
    }
1290182
public function withAttribute(string $offset, $value) : self
    {
        if ($this->restricted) {
            if (!in_array($offset, array_keys($this->attributes))) {
                $message = sprintf('%s it not an allowed attribute on this object. The only allowed attributes are %s', $offset, implode(',', array_keys($this->attributes)));
                throw new \InvalidArgumentException($message);
            }
        }

        $that = clone($this);
        $that->attributes[$offset] = $value;
        return $that;
    }
29938
public function setButton($content, array $attr = [])
    {
        if (is_array($content)) {
            $attr = $content[1];
            $content = $content[0];
        }

        $this->button = [
            $content, $attr
        ];

        return $this;
    }
272125
public function label($value)
    {
        $lastRules = $this->_validations[count($this->_validations) - 1]['attributes'];
        $this->labels([$lastRules[0] => $value]);
        return $this;
    }
837162
public function setValue($value)
    {
        if (\is_array($value)) {
            $this->setValueArray($value);
            $value = implode(', ', $value);
        }

        $this->setAttribute('value', $value);

        return $this;
    }
306086
public function setAttribute( $attr, $value ) {
        //value is the text node
        //we add this for the sake of consistency amongst other form elements
        if( strtolower( $attr ) == 'value' ) {
           $this->setText( $value );
        } else {
            parent::setAttribute( $attr, $value );
        }
    }
293661
public function addAttribute($attribute, $value)
    {
        $value = is_array($value) ? $value : [$value];

        if (!isset($this->attributes[$attribute])) {
            $this->attributes[$attribute] = [];
        }
        foreach ($value as $attrValue) {
            $this->attributes[$attribute][] = $attrValue;
        }

        return $this;
    }
1106645
public function setAttribute($attribute, $value)
    {
        Arr::set($this->attributes, $attribute, $value);

        return $this;
    }
965332
public function setMessages($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['Messages']['FieldValue'] = $value;
        return $this;
    }
446772
public function setTypes($attr, $type = null)
    {
        if (is_array($attr))
            $this->inputType = array_merge($this->inputType, $attr);
        else
            $this->inputType[$attr] = $type;

        return $this;
    }