Fixes for new behaviour
This commit is contained in:
parent
fe2d66792c
commit
fd61da4b7b
1 changed files with 28 additions and 1 deletions
29
src/View.php
29
src/View.php
|
|
@ -9,7 +9,7 @@ class View {
|
||||||
* Root path for includes app folders
|
* 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
|
* 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();
|
static public $header=array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array with config_paths for load configurations.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static public $config_path=['settings'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The construct for create a view object
|
* 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.
|
* 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];
|
$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
|
//Load function from loaded view with his parameters
|
||||||
|
|
||||||
//array_unshift($arr_template_values, $this);
|
//array_unshift($arr_template_values, $this);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue