webtechnick / CakePHP-Facebook-Plugin

CakePHP Facebook Plugin
http://facebook.webtechnick.com
445 stars 138 forks source link

any kind of "redirect" cannot use in function options #84

Open nguyenanhthai opened 12 years ago

nguyenanhthai commented 12 years ago

I have a issue when I uses the plugin, I cannot use "redirect" in Helper Facebook::login() and logout(). I also can not use function afterFacebookLogin() to redirect, the app will only redirect only if I refresh the page.

Example when my code in view is: <?php echo $this->Facebook->logout(array('redirect' => array('controller' => 'users', 'action' => 'logout'))); ?>

===> my logout button disappears.

when I debug(Router::url($options['redirect']));

this show the wrong url. May be any wrong when I config?

Any Suggestion for me?

jeffersonrbr commented 12 years ago

try this way: <?php echo $this->Facebook->logout(array('redirect' => 'logout'', 'label' => 'Logout')); ?> if you want to put an image instead text try this way <?php echo $this->Facebook->logout(array('redirect' => 'logout'', 'label' => 'Logout', 'img' => 'connectwithfacebook.gif')); ?>