-
Notifications
You must be signed in to change notification settings - Fork 13
/
Facebook.php
53 lines (47 loc) · 1.17 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
52
53
<?php
/**
* @link https://github.com/yiimaker/yii2-social-share
* @copyright Copyright (c) 2017-2021 Volodymyr Kupriienko
* @license BSD 3-Clause License
*/
namespace ymaker\social\share\drivers;
use ymaker\social\share\base\AbstractDriver;
/**
* Driver for Facebook.
*
* @see https://facebook.com
*
* @author Vladimir Kuprienko <[email protected]>
*
* @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}'],
];
}
}