* zin: support to accept null value in setData.

This commit is contained in:
sunhao
2024-01-19 16:00:24 +08:00
parent 0348053d17
commit 1f5fc14cc6
+2 -1
View File
@@ -109,8 +109,9 @@ function setTag(string $id): directive
* @param mixed $value
* @return directive
*/
function setData(string|array $name, mixed $value = null): directive
function setData(null|string|array $name, mixed $value = null): directive
{
if($name === null) return set(null);
$map = is_array($name) ? $name : array($name => $value);
$attrs = array();
foreach($map as $key => $value)