Commit 8a83ab04 authored by Sylvain's avatar Sylvain

Mise à jour du Dinamik route

parent b0f7e6fe
......@@ -143,19 +143,29 @@ class Dynamik
public function getUrlValue($data)
{
$value = null;
$route = $this->getValue($data['route']);
$args = $data['args'];
// Préparation des arguments pour la route
if (!is_array($args)) {
$args = [$args];
}
$arguments = [];
foreach ($args as $key => $val) {
$arguments[$key] = $this->getValue($val);
}
if (is_array($data)) {
if (array_key_exists('route', $data)) {
$route = $this->getValue($data['route']);
$args = $data['args'];
// Préparation des arguments pour la route
if (!is_array($args)) {
$args = [$args];
}
$arguments = [];
foreach ($args as $key => $val) {
$arguments[$key] = $this->getValue($val);
}
$value = route($route, $arguments);
$value = route($route, $arguments);
} else {
$value = $this->getValue($data);
}
} else {
$value = $data;
}
return $value;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment