jjjjjjjjjjjjjjj 发表于 2019-3-25 17:58:55

在外部访问model中的常量要用那个函数?

class Test extends CI_Controller
{

    public function index()
    {
      $this->load->model('user_model');

      echo $this->user_model->get('table');
      exit;

    }

}


class User_model extends CI_Model

{
    const TABLE = 'user';

   
}


Fatal error: Call to undefined method User_model::get() in
提示get不能用?

Skiy 发表于 2019-3-27 09:15:18

User_model::TABLE
页: [1]
查看完整版本: 在外部访问model中的常量要用那个函数?