mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
Fix for substitutions passed in via twig function (they need to be in an array) - #574
This commit is contained in:
@@ -45,8 +45,19 @@ class AdminTwigExtension extends \Twig_Extension
|
||||
];
|
||||
}
|
||||
|
||||
public function tuFilter($args, $lang = null)
|
||||
public function tuFilter()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$numargs = count($args);
|
||||
$lang = null;
|
||||
|
||||
if (($numargs == 3 && is_array($args[1])) || ($numargs == 2 && !is_array($args[1]))) {
|
||||
$lang = array_pop($args);
|
||||
} elseif ($numargs == 2 && is_array($args[1])) {
|
||||
$subs = array_pop($args);
|
||||
$args = array_merge($args, $subs);
|
||||
}
|
||||
|
||||
return $this->grav['admin']->translate($args, $lang);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user