Created
July 22, 2013 05:35
-
-
Save WenLiangTseng/6051500 to your computer and use it in GitHub Desktop.
CodeIgniter-在函數裡呼叫$this的方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function is_logged_in() { | |
// Get current CodeIgniter instance | |
$CI =& get_instance(); | |
// We need to use $CI->session instead of $this->session | |
$user = $CI->session->userdata('user_data'); | |
if (!isset($user)) { return false; } else { return true; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment