Facebook Connect PHP Toolkit is a PHP library containing a number of the most used Facebook Graph API UI controls that are used on Facebook Connect websites. Since the library is implemented as PHP wrappers around Facebook API, it hides the implementation complexity from the developer and offers a very clean and understandable user interface.


Facebook Graph API UI Controls from the Facebook Connect PHP Toolkit are primarily intended for usage on Facebook Connect websites, but since Facebook iFrame applications are based on the same technologies, the controls are fully functional and usable in Facebook iFrame applications as well.

All components from the library are based of Facebook Graph API JavaScript SDK and XFBML (also implemented on SDK). Using the toolkit components allows the Facebook application developer to make a pure PHP project without using any of the Facebook Graph API JavaScript calls or XFBML. Hence, the toolkit saves a lot of development time that would be otherwise spent on reading and learning the Facebook Graph API JavaScript SDK and XFBML.

By using the toolkit, the source code becomes much cleaner and easier to maintain. Another important fact is that your code is not affected by Facebook API changes. Facebook API has gone through tremendous changes since the first version release, but often it is possible to keep the existing application features functional just by changing the implementation to be compliant with the new changes. But having a lot of applications with a lot of pages that use Facebook features requires a lot of maintenance effort from the developer. As the toolkit is based on object oriented principle "Decouple interface from implementation", it is enough to update the toolkit and replace the old toolkit version with the updated one.

Live presentation of the Facebook Graph API UI controls can be seen in Facebook Connect Demo Website. Each toolkit component is presented and accompanied with some source code samples. Demo Website is also used as a Starter Kit since it also contains initialization of the Facebook Graph API and an example of how to use the Graph API to get the data of the logged user and his friends.

The section below contains a list of all toolkit components. You can find a detailed description of the component, its usage and all of its methods. Pictures and code examples are also included.



Toolkit classes

facebook connect graph api Facebook Login Button is used to connect a web site to the Facebook and allow it to use the Facebook API. When a user logs-in once, all controls from this list will work without any additional logging-in.
facebook connect graph api Facebook Invite Friends is used to invite friends to use Facebook application or Facebook Connect website by sending an invite requests. There are two types of the invite control: a classic one and a condensed one.
facebook connect graph api Facebook Stream Publish is used to publish stories on the user profile, friends' profiles, or the Facebook page. The control also offers the possibility of setting some JavaScript code to be executed and setting a form id to be submitted after the story is published successfully.
facebook connect graph api Facebook Extended Permissions is used to allow the user to add extended permissions to a Facebook application. Example of that would be sending upload images and status updates.
facebook connect graph api Facebook Like Button allows the user of your website to share interesting content with his friends. After the user clicks the 'Like' button, a story in the user's friends' News Feed appears with the link to your website which can potentially increase the number of visitors to your website.
facebook connect php Facebook Like Box allows users of your web site to become fans of its Facebook page. They can also see messages from the page wall and the list of other people who are fans of the page.
facebook connect php Facebook Comments allows the user of your web site to write comments and share them with their friends by posting them on their profiles. Posting a comment on user's wall can easily result in more visitors from the Facebook to your site.
facebook connect php Facebook Recommendations can be used to place interesting content for a particular domain, in a form of a list. The list that is created is based on user’s personal preferences and shared content by other people.
facebook connect php Facebook Bookmark Button offers users to easily bookmark your website inside the Facebook environment. Once an application is bookmarked, the button will not be displayed anymore.
facebook connect php Facebook Send Button is used by users of website to share interesting content with their friends by selecting them from friends list. This will result in sending the message to friends' inbox.
facebook connect php Facebook Request Dialog is used to invite friends to start using an application, or to send requests for some specific action to application users.
facebook connect php Facebook Custom Login Button have the same purpose as Facebook Login Button, but while Facebook Login Button has predefined appearance which is rendered on Facebook server, Custom Login Button can be defined by user.
facebook connect php Facebook Logout Button is used to disconnect connection between application and Facebook. It is implemented to supports 4 types of command: button, link, image and auto open on page load.