Fixes on load_model

This commit is contained in:
Antonio de la Rosa 2015-05-10 15:24:36 +02:00
parent 1d19037145
commit d03e7e1bf1

View file

@ -76,6 +76,12 @@ class Webmodel {
static public $prefix_db=''; static public $prefix_db='';
/**
* Array for check if a model was loaded.
*/
static public $cache_model=array();
/** /**
* *
* With this property, you can define what is the server connection that you have to use for read the source data. * With this property, you can define what is the server connection that you have to use for read the source data.
@ -254,17 +260,6 @@ class Webmodel {
} }
/**
* Method for load config from a project.
*/
static public function load_config()
{
//if(is_file($this->path_mo
}
/** /**
* Method for load models from a project. * Method for load models from a project.
* *
@ -290,25 +285,15 @@ class Webmodel {
$path_model=Webmodel::$model_path.$app_model.'/'.Webmodel::$model_folder.'/models_'.$model.'.php'; $path_model=Webmodel::$model_path.$app_model.'/'.Webmodel::$model_folder.'/models_'.$model.'.php';
if(!isset(Webmodel::$cache_model[$app_model.'/'.$model]))
{
if(is_file($path_model)) if(is_file($path_model))
{ {
include($path_model); include($path_model);
/*$func_load=$model.'ModelLoad'; Webmodel::$cache_model[$app_model.'/'.$model]=1;
if(!function_exists($func_load))
{
throw new \Exception('Error: function '.$func_load.' not found in '.$path_model);
}
else
{
return $func_load();
}*/
} }
else else
@ -320,6 +305,8 @@ class Webmodel {
} }
}
/** /**
* Method for connect to the db * Method for connect to the db
* *