for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/yiimaker/yii2-social-share
* @copyright Copyright (c) 2017 Yii Maker
* @license BSD 3-Clause License
*/
namespace ymaker\social\share\drivers;
use ymaker\social\share\base\DriverAbstract;
* DriverAbstract for Telegram messenger.
* @link https://telegram.org
*
* @author Vladimir Kuprienko <[email protected]>
* @since 1.0
class Telegram extends DriverAbstract
{
* @var bool|string
public $message = false;
* @inheritdoc
protected function processShareData()
$this->url = static::encodeData($this->url);
if (is_string($this->message)) {
$this->appendToData('message', $this->message);
}
protected function buildLink()
$link = 'https://telegram.me/share/url?url={url}';
if ($this->message) {
$this->addUrlParam($link, 'text', '{message}');
return $link;