From 2acbd34b61902be91f5519799e75af4f0cc77e19 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 6 Mar 2018 09:27:54 +0000 Subject: [PATCH] outputhtml : allow an autoloader class git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4143 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- outputhtml.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/outputhtml.php b/outputhtml.php index 8549967..2602322 100644 --- a/outputhtml.php +++ b/outputhtml.php @@ -36,12 +36,15 @@ class outputhtml extends output $resView = $data; if ($viewClass !== FALSE && $viewMethod !== FALSE) { - if (! class_exists ($viewClass) && empty (spl_autoload_functions ())) + if (! class_exists ($viewClass)) { - if ($module !== "") + if ($module !== "" && + file_exists ("modules/$module/views/$viewClass.php")) require_once ("modules/$module/views/$viewClass.php"); - else + elseif (file_exists ("views/$viewClass.php")) require_once ("views/$viewClass.php"); + // If the file doesn't exists, an autoloader maybe exists. If it is not + // the case, the class will not be found } $obj = new $viewClass; $resView = $obj->$viewMethod ($data, $variable);