access database in a helper function ?

<?php
if(! function_exists('get_user_info')){

        function get_user_info($field)
        {
            $ci = & get_instance();
            $ci->load->model('users');
            return $ci->users->get_user_profile($field);
        }
}
?>
 
原文地址:https://www.cnblogs.com/zl0372/p/CI.html