-
Notifications
You must be signed in to change notification settings - Fork 13
/
Facebook.php
51 lines (46 loc) · 1.15 KB
/
Facebook.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @link https://github.com/yiimaker/yii2-social-share
* @copyright Copyright (c) 2017-2019 Yii Maker
* @license BSD 3-Clause License
*/
namespace ymaker\social\share\drivers;
use ymaker\social\share\base\AbstractDriver;
/**
* Driver for Facebook.
*
* @link https://facebook.com
*
* @author Vladimir Kuprienko <vldmr.kuprienko@gmail.com>
* @since 1.0
*/
class Facebook extends AbstractDriver
{
/**
* {@inheritdoc}
*/
protected function processShareData()
{
$this->url = static::encodeData($this->url);
}
/**
* {@inheritdoc}
*/
protected function buildLink()
{
return 'http://www.facebook.com/sharer.php?u={url}';
}
/**
* @return array
*/
protected function getMetaTags()
{
return [
['property' => 'og:url', 'content' => '{url}'],
['property' => 'og:type', 'content' => 'website'],
['property' => 'og:title', 'content' => '{title}'],
['property' => 'og:description', 'content' => '{description}'],
['property' => 'og:image', 'content' => '{imageUrl}'],
];
}
}