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. There is also an option to send it to the wall of group that user is fan of, or any email address.

This class is a member of Facebook Connect PHP Toolkit. To see all classes from the toolkit, please look at the Facebook Connect Graph API classes.


Send Button Image

Following image represents the defualt Facebook Send Button with opened popup dialog for selecting friends.

facebook send button php


PHP Example

The example shows default Facebook Send Button, which is shown on picture above. The example shows the code of whole page, but important content is highlighted: required includes and initialization for any page with brown color, and working with Facebook Send Button PHP class with blue color.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
       <title>Facebook Send Button PHP Example</title>
    </head>
    <body>
        <?php
            require_once 'facebook.php';
            require_once 'faceconn/faceconn.php';
            UseGraphAPI();

            $send = new SendButton();
            $send->Render();
        ?>
        </body>
</html>



Facebook Send Button PHP class has a demo page inside Demo Website where it can be seen how it works. The most important fact is that the Demo website is contained in package with Facebook Connect PHP Toolkit which is very useful resource of code examples for each control from the toolkit. Look at the Facebook Send Button Demo page.


Configuration

Configuration of the Facebook Send Button PHP class is done through calls of the setter methods, which in turn set the private properties. For Facebook Send Button PHP class, there are no required properties to set. All you have to do is to create new instance of the class and call Render() method. All properties from the list below are optional.

facebook send button php
Method Name
Type
Description
facebook send button php
SetUrl
String
Function sets the URL of the send button. If it's not set, current page URL is used.
facebook send button php
SetFont
Int
Function sets the font inside the send button. Available values are 'arial', 'lucida grande', 'segoe ui', 'tahoma', 'trebuchet ms' and 'verdana'.
facebook send button php
SetColorScheme
String
Function sets the color scheme. Available values are 'light' and 'dark'. Deault value is 'light'.
facebook send button php
SetRef
Int
Function sets the reference string for tracking referals.