MetaModels\Widgets\MultiTextWidget::__set PHP Method

__set() public method

Add specific attributes.
public __set ( string $strKey, mixed $varValue ) : void
$strKey string Name of the key to set.
$varValue mixed The value to use.
return void
    public function __set($strKey, $varValue)
    {
        switch ($strKey) {
            case 'maxlength':
                if ($varValue > 0) {
                    $this->arrAttributes['maxlength'] = $varValue;
                }
                break;
            case 'mandatory':
                if ($varValue) {
                    $this->arrAttributes['required'] = 'required';
                } else {
                    unset($this->arrAttributes['required']);
                }
                parent::__set($strKey, $varValue);
                break;
            case 'placeholder':
                $this->arrAttributes['placeholder'] = $varValue;
                break;
            default:
                parent::__set($strKey, $varValue);
                break;
        }
    }