fix: choose the correct key when setting widget value (#1702)

This commit is contained in:
joyqi 2024-01-10 15:37:05 +08:00 committed by GitHub
parent 0d28025bf4
commit a30a6c122d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -481,7 +481,14 @@ abstract class Widget
*/
public function __set(string $name, $value)
{
$this->row[$name] = $value;
$method = '___' . $name;
$key = '#' . $name;
if (isset($this->row[$key]) || method_exists($this, $method)) {
$this->row[$key] = $value;
} else {
$this->row[$name] = $value;
}
}
/**