Created
April 27, 2012 13:28
-
-
Save awartoft/2509208 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Antoine Hedgecock <[email protected]> | |
*/ | |
/** | |
* @namespace | |
*/ | |
namespace Facebook\View\Helper; | |
use Zend\View\Helper\AbstractHelper, | |
Facebook\Service\Facebook as FacebookService; | |
/** | |
* @category Facebook | |
* @package View | |
* @subpackage Helper | |
*/ | |
class Facebook extends AbstractHelper | |
{ | |
/** | |
* @var \Facebook\Service\Facebook | |
*/ | |
protected $service; | |
/** | |
* @param \Facebook\Service\Facebook $service | |
*/ | |
public function __construct(FacebookService $service) | |
{ | |
$this->service = $service; | |
} | |
public function initialize() | |
{ | |
$script = 'js/plugins/facebook.js'; | |
$source = "$(function() { jQuery.fn.facebook('init', " . $this->service->appId . "});"; | |
$headScript = $this->getView() | |
->plugin('headScript'); | |
$headScript->appendFile($script); | |
$headScript->appendScript($source); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment