2012-11-06 2 views
2

내 프로젝트에 Twitter 로그인을 구현하고 싶습니다. 내 프로젝트는 CodeIgniter에 코딩되어 있습니다. 누군가가 나에게 이걸 구현하기위한 단계별 프로세스를 제공 할 수 있습니까?CodeIgniter에서 Twitter 로그인 구현

답변

2
//use Codeigniter-TwitterOAuth 
//https://github.com/MunGell/Codeigniter-TwitterOAuth 
//download url: https://github.com/MunGell/Codeigniter-TwitterOAuth/archive/master.zip 
//Usage 

    // There are two ways to load library to Codeigniter. Automatically within ./config/autoload.php or directly in your controller by adding this line: 

    $this->load->library('twitteroauth'); 

    //Create an instance: 

    $connection = $this->twitteroauth->create($consumer, $consumer_secret, $access_token, $access_token_secret); 

    //Verify your authentication details: 

    $content = $connection->get('account/verify_credentials'); 

    //Send a message: 

    $data = array(
     'status' => $message, 
     'in_reply_to_status_id' => $in_reply_to 
    ); 
    $result = $connection->post('statuses/update', $data);