/** * Add specific attributes * * @param string $strKey * @param mixed $varValue */ public function __set($strKey, $varValue) { switch ($strKey) { case 'options': $this->arrOptions = \StringUtil::deserialize($varValue); break; default: parent::__set($strKey, $varValue); break; } }
/** * Add specific attributes * * @param string $strKey The attribute name * @param mixed $varValue The attribute value */ public function __set($strKey, $varValue) { switch ($strKey) { case 'placeholder': $this->arrAttributes['placeholder'] = $varValue; break; case 'required': case 'mandatory': case 'minlength': case 'maxlength': // Ignore break; default: parent::__set($strKey, $varValue); break; } }
/** * Add specific attributes * * @param string $strKey The attribute name * @param mixed $varValue The attribute value */ 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; } }