PHP Constructor
From Facebook Developer Wiki (FbDevWiki.com)
You need to create an instance of the "Facebook" object in PHP in order to call the methods of that object. The constructor takes a single associative array as an argument. If you create the new object by $facebook = new Facebook(array( ... ));
then you can call all of the methods by $facebook->some_method( ... );
afterwards.
Example:
require 'facebook.php'; $facebook = new Facebook(array( 'appId' => 'YOUR APP ID', 'secret' => 'YOUR API SECRET', 'cookie' => true, // enable optional cookie support 'domain' => '.example.com' ));
Parameters
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config | array |
|
All of the constructor arguments can be changed after initializing the Facebook
object by use of the PHP getters/setters.