Added support for load views from other modules

This commit is contained in:
Antonio de la Rosa 2015-10-05 04:41:36 +02:00
parent f6639f8492
commit fe32dba8fc

View file

@ -146,7 +146,7 @@ class View {
* @param string $module_theme If the view are on a different theme and you don't want put the view on the theme, use this variable for go to the other theme. * @param string $module_theme If the view are on a different theme and you don't want put the view on the theme, use this variable for go to the other theme.
*/ */
static public function load_view($arr_template_values, $template) static public function load_view($arr_template_values, $template, $module='')
{ {
//First see in controller/view/template, if not see in /views/template //First see in controller/view/template, if not see in /views/template
@ -158,6 +158,15 @@ class View {
if(!isset(View::$cache_template[$template])) if(!isset(View::$cache_template[$template]))
{ {
if($module!='')
{
//vendor/phangoapp/admin/views
View::$folder_env[]='vendor/'.$module.'/views';
}
foreach(View::$folder_env as $base_path) foreach(View::$folder_env as $base_path)
{ {