Hello,
I want to make function to display an error template, but without success.
Here's the code, i want to make it:
function inline_errors($errors, $title="") {
global $tpl;
if(!is_array($errors)) {
$errors = array($errors);
}
if(empty($title)) {
$title = "Please correct the following errors!";
}
$errorlist = $errors;
$tpl->error_title = $title;
$tpl->errorlist = $errorlist;
$tpl->display('templates/errors/inline_errors.tpl.php');
}
Is there something wrong, or i cannot use $tpls->display in functions?
Best regards.