In CI 3 i can load view file in helper like this.
if ( !function_exists('render_admin_view') ) {
function render_admin_view($filename, $data) {
$ci = &get_instance();
$dir = $ci->config->item('admin_dir');
$ci->load->view($dir . 'common/header', $data);
$ci->load->view($filename, $data);
$ci->load->view($dir . 'common/menu', $data);
$ci->load->view($dir . 'common/footer', $data);
}
}
But in CI 4, when i use this function in my custom helper, it shows following error.
Call to undefined function get_instance()
How can i load view file in helper in CI 4 ?