mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
mvc: allow to unset attribute via setAttributeValue
SimpleXML elements have no way of removing attributes so let the base field do the work.
This commit is contained in:
parent
8d20e2587d
commit
073681f895
@ -376,7 +376,11 @@ abstract class BaseField
|
||||
*/
|
||||
public function setAttributeValue($key, $value)
|
||||
{
|
||||
$this->internalAttributes[$key] = $value;
|
||||
if ($value !== null) {
|
||||
$this->internalAttributes[$key] = $value;
|
||||
} elseif (isset($this->internalAttributes[$key])) {
|
||||
unset($this->internalAttributes[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user