From fd61da4b7bb28b726e9e7a0105082d9cbf182807 Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Tue, 18 Aug 2015 02:03:22 +0200 Subject: [PATCH 1/2] Fixes for new behaviour --- src/View.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/View.php b/src/View.php index 9cb9ca0..e6da3ea 100644 --- a/src/View.php +++ b/src/View.php @@ -9,7 +9,7 @@ class View { * Root path for includes app folders */ - static public $root_path=__DIR__; + static public $root_path="."; /** * A set of paths inside of $root_path contining views. If a view is located, the foreach for search the view is break @@ -95,6 +95,12 @@ class View { static public $header=array(); + /** + * An array with config_paths for load configurations. + */ + + static public $config_path=['settings']; + /** * The construct for create a view object * @@ -117,6 +123,19 @@ class View { }*/ + static public function load_config() + { + + //Load config here + foreach(View::config_path as $config) + { + + Utils::load_config("config_views", $config); + + } + + } + /** * Very important function used for load views. Is the V in the MVC paradigm. Phango is an MVC framework and has separate code and html. * @@ -181,6 +200,14 @@ class View { $func_view=View::$cache_template[$template]; + if(!function_exists($func_view)) + { + + throw new \Exception('Error: Template file loaded but function '.$func_view.' not found: '.implode(' and ', $all_path)); + die; + + } + //Load function from loaded view with his parameters //array_unshift($arr_template_values, $this); From 33815ae5c7121bcf349a30ebdd77846d1b826f34 Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Thu, 27 Aug 2015 04:31:23 +0200 Subject: [PATCH 2/2] Little fix on View --- src/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View.php b/src/View.php index e6da3ea..a1bea2d 100644 --- a/src/View.php +++ b/src/View.php @@ -605,7 +605,7 @@ class View { $_SESSION['flash_txt']=''; - return View::load_view(array($text), 'common/utilities/flash'); + return View::load_view(array($text), 'common/utils/flash'); } }