Skip to content

Instantly share code, notes, and snippets.

@cj
Created December 30, 2010 22:15
Show Gist options
  • Save cj/760388 to your computer and use it in GitHub Desktop.
Save cj/760388 to your computer and use it in GitHub Desktop.
<?
/**
* Load global view temp
*
* @author CJ Lazell
* @param string $filename
* @param array $data
* @param boolean $string
* @return void
*/
if ( ! function_exists('view_temp'))
{
function view_temp($filename, $data = '', $string = FALSE)
{
$vi = Ssc::instance();
$return = FALSE;
if(isset($vi->_ew->app_view_folder{1})) { $return = TRUE; } // if view folder changed don't show errors ..
$module_view_folder= $path = DIR. $GLOBALS['d'] . DS .'views'. $vi->_ew->app_view_folder;
$app_view_folder= APP .'views'. $vi->_ew->app_view_folder;
if(file_exists($module_view_folder . $filename .EXT))
$path = $module_view_folder;
else
$path= $app_view_folder;
profiler_set('app_views', $filename, $path . $filename .EXT);
return _load_view($path, $filename, $data, $string, $return, __FUNCTION__);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment