From 38efa5468aca2a8d62ce962446d3927f84b76433 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 15 Nov 2018 14:09:06 +0000 Subject: [PATCH] Do the replacement at the end (to update {baseurl} if it is set by the {javascript} git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4714 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- outputhtml.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/outputhtml.php b/outputhtml.php index ced574d..9ff078f 100644 --- a/outputhtml.php +++ b/outputhtml.php @@ -87,12 +87,6 @@ class outputhtml extends output EOT; } - // Do the title replacement in the replacement structure - if (! isset ($replacement["{flash}"])) - $replacement["{flash}"] = ""; - foreach ($replacement as $key=>$val) - $layoutPage = str_replace ($key, $val, $layoutPage); - // All the entries coming from views in array are substitute in layout // {content}, {title} if (is_array ($resView)) @@ -105,6 +99,12 @@ EOT; else $layoutPage = str_replace ("{content}", $resView, $layoutPage); + // Do the title replacement in the replacement structure + if (! isset ($replacement["{flash}"])) + $replacement["{flash}"] = ""; + foreach ($replacement as $key=>$val) + $layoutPage = str_replace ($key, $val, $layoutPage); + // Remove the not used {XXX} $layoutPage = preg_replace ("~({\S+})~", "", $layoutPage);