2016-12-29 77 views
1

我想問我該如何檢查/看到這個$datame裏面的值在我的代碼中,我試圖var_dump它,我使用的是mozilla,它沒有在控制檯/網絡中顯示值。我在哪裏或如何檢查是否有數據存儲在我的變量數組中。如何檢查codeigniter控制器中的變量/數據的值

public function facebook_request(){ 
     $this->load->library('facebook/src/facebook', array('appId' => '1027885817316593', 'secret' => '6db175699897b514bf4881955b2944bb')); 
     $this->user = $this->facebook->getUser(); 
     if ($this->user) { 
      $data['user_profile'] = $this->facebook->api('/me?fields=id,first_name,last_name,email,link,gender,locale,picture'); 

      // Get logout url of facebook 
      $data['logout_url'] = $this->facebook->getLogoutUrl(array('next' => base_url() . 'index.php/oauth_login/logout')); 

       $datame = array(
        'oauth_provider'=> 'facebook', 
        'oauth_uid'  => $data['user_profile']['id'], 
        'first_name' => $data['user_profile']['first_name'], 
        'last_name'  => $data['user_profile']['last_name'], 
        'email'   => $data['user_profile']['email'], 
        'gender'  => $data['user_profile']['gender'], 
        'locale'  => $data['user_profile']['locale'], 
        'picture'  => $data['user_profile']['picture']['data']['url'], 
        'link'   => $data['user_profile']['link'] 
       ); 
       $userData = $this->user_model->checkUser2($datame); 
       var_dump($datame); 
       exit(); 

      // Send data to profile page 
      $this->load->view('admin/profile.php', $data); 

     } 

回答

0

服務器無權寫入。你可以通過$datame您試圖渲染和打印有看法,或者你可以用error_log($datame)取代var_dump($datame)然後查看您的錯誤日誌,看看它印

+0

您好先生,我可以在哪裏看到error_log?我在codeigniter中不擅長。 –

+0

@JJJohn你應該可以在'/ var/log/httpd/error_log'中看到它。可能需要首先'sudo' –

+0

您好先生..我正在使用Windows 7操作系統。它是否內置在codeigniter中? –

0

$userData = $this->user_model->checkUser2($datame); 
var_dump($datame); 
exit(); 

變化

echo "<pre>"; 
print_r($datame); 
exit(); 
$userData = $this->user_model->checkUser2($datame); 
相關問題