2011-03-19 151 views
2

,所以我有这个Facebook登录按钮:Facebook登录按钮注销文本

<fb:login-button autologoutlink="true" 
       onlogin="Log.info('onlogin callback')"> 
</fb:login-button> 

但后来,一旦你登录,注销按钮文本变得非常长

我如何可以更改文本显示在注销按钮,使它更短?

回答

2

嗨 在我的应用程序中,我检查用户是否已登录,并给出相应的按钮文本文本。

if($this->loggedIn){ 
    $button = '<div id="fb-root"></div><fb:login-button perms="email,user_birthday" onlogin="window.location.reload(true);" autologoutlink="true">Logout</fb:login-button>'; 
    } 
    else { 
     $button = '<div id="fb-root"></div><fb:login-button perms="email,user_birthday" autologoutlink="true"></fb:login-button>'; 
    } 

希望这会为你工作太