HosipLan

Untitled

Jan 19th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. class BasePresenter {
  2.  
  3.     /**
  4.      * @return Fb\FacebookControl
  5.      */
  6.     protected function createComponentFacebook()
  7.     {
  8.         $fb = new Fb\FacebookControl($this->facebook, $this->context->cacheStorage);
  9.         $fb->on['login']['response'][] = function (Fb\Dialog\LoginDialog $dialog) {
  10.             $me = $dialog->facebook->api('/me');
  11.             $dialog->presenter->flashMessage("Nice to meet you, " . $me['first_name'] . '!');
  12.         };
  13.         return $fb;
  14.     }
  15.  
  16.  
  17.  
  18.  
  19. class ConcretePresenter {
  20.  
  21.     /**
  22.      * @return Kdyby\Facebook\FacebookControl
  23.      */
  24.     protected function createComponentFacebook()
  25.     {
  26.         $fb = parent::createComponentFacebook();
  27.         $fb->on['login']['response'][] = $this->fillProfilesFromFacebook;
  28.         return $fb;
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment