개인 정보 보호라는 라이브러리가 있습니다. _user_block_by_team 이라는 private 함수를 만들고 다음 코드와 같은 라이브러리의 다른 공용 함수에서이 함수를 호출하고 싶습니다. 나 오류가 Fatal error: Call to undefined method Team::_user_block_by_team()
어디에서 실수를하고있는거야? 이 라이브러리는 그냥 $this->_user_block_by_team($id_user)
를 호출 할 수있는 파일 autoload.php라이브러리 codeigniter에서 private 메서드를 호출하는 방법
class Privacy {
function __construct()
{
$this->ci =& get_instance();
}
function user_block_team($id_user) {
$this->ci->_user_block_by_team($id_user);
}
function _user_block_by_team($id_user) {
$this->ci->load->library('settings');
if ($this->ci->settings->check_user_blocked($id_user)) {
return false;
}
return true;
}
}
$ this-> ci를 사용할 필요가 없습니다. 단지 $ this-> –
예, 정확히 감사합니다 – fabrizio