<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Class MY_Loader
*/
class MY_Loader extends CI_Loader
{
public function view($view, $vars = array(), $return = FALSE)
{
$ci = get_instance();
/** @var CI_Config $config */
$config = $ci->config;
if ('smarty' == $config->item('view_template')) {
/** @var CI_Smarty $smarty */
$smarty = $ci->smarty;
foreach ($vars as $name => $value) {
$smarty->assign($name, $value);
}
return $smarty->display($view);
} else {
return parent::view($view, $vars, $return);
}
}
}