src/Presenters/BusinessPresenter.php
public function facebookImg($type = 'square')
    {
        $url = parse_url($this->wrappedObject->social_facebook);

        if(!$this->wrappedObject->social_facebook || !array_key_exists('path', $url)){
            return "<img class=\"img-thumbnail\" src=\"//placehold.it/100x100\" height=\"100\" width=\"100\" alt=\"{$this->wrappedObject->name}\"/>";
        }

        $userId = trim($url['path'], '/');

        if ($url['path'] == '/profile.php') {
            parse_str($url['query'], $parts);
            $userId = $parts['id'];
        }

        $url = "http://graph.facebook.com/{$userId}/picture?type=$type";

        return "<img class=\"img-thumbnail media-object\" src=\"$url\" height=\"100\" width=\"100\" alt=\"{$this->wrappedObject->name}\"/>";
    }
public function facebookImg($type = 'square')
    {
        $url = parse_url($this->wrappedObject->social_facebook);

        if(!$this->wrappedObject->social_facebook || !array_key_exists('path', $url)){
            return "<img class=\"img-thumbnail\" src=\"//placehold.it/100x100\" height=\"100\" width=\"100\" alt=\"{$this->wrappedObject->name}\"/>";
        }

        $userId = trim($url['path'], '/');

        if ($url['path'] == '/profile.php') {
            parse_str($url['query'], $parts);
            $userId = $parts['id'];
        }

        $url = "http://graph.facebook.com/{$userId}/picture?type=$type";

        return "<img class=\"img-thumbnail media-object\" src=\"$url\" height=\"100\" width=\"100\" alt=\"{$this->wrappedObject->name}\"/>";
    }
public function facebookImg ( $ type = 'square' ) { $ url = parse_url ( $ this -> wrappedObject -> social_facebook ) ; if ( ! $ this -> wrappedObject -> social_facebook || ! array_key_exists ( 'path' , $ url ) ) { return "<img class=\"img-thumbnail\" src=\"//placehold.it/100x100\" height=\"100\" width=\"100\" alt=\"{$this->wrappedObject->name}\"/>" ; } $ userId = trim ( $ url [ 'path' ] , '/' ) ; if ( $ url [ 'path' ] == '/profile.php' ) { parse_str ( $ url [ 'query' ] , $ parts ) ; $ userId = $ parts [ 'id' ] ; } $ url = "http://graph.facebook.com/{$userId}/picture?type=$type" ; return "<img class=\"img-thumbnail media-object\" src=\"$url\" height=\"100\" width=\"100\" alt=\"{$this->wrappedObject->name}\"/>" ; }
get Facebook Profile Public Picture.

@param string $type Type of picture to print

@return string HTML code to render img with facebook picture
get Facebook Profile Public Picture .