backports murph-skeleton

This commit is contained in:
Simon Vieille 2021-06-02 19:22:35 +02:00
parent 6f2a9e9c7b
commit 68cae2442f

View file

@ -53,16 +53,16 @@ class CrudExtension extends AbstractExtension
} }
if (is_callable($hrefConfig)) { if (is_callable($hrefConfig)) {
$href = call_user_func($hrefConfig, $entity, $config['options']); $attrs['href'] = call_user_func($hrefConfig, $entity, $config['options']);
} else { } else {
$href = $hrefConfig; $attrs['href'] = $hrefConfig;
} }
foreach ($attrs as $k => $v) { foreach ($attrs as $k => $v) {
$attributes .= sprintf('%s="%s" ', htmlspecialchars($k), htmlspecialchars($v)); $attributes .= sprintf(' %s="%s" ', htmlspecialchars($k), htmlspecialchars($v));
} }
$render = sprintf('<a href="%s" %s>%s</a>', htmlspecialchars($href), $attributes, $render); $render = sprintf('<a%s>%s</a>', $attributes, $render);
} }
return $render; return $render;