PHPackages                             cybercog/yii2-twittable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. cybercog/yii2-twittable

AbandonedArchivedYii2-extension[Framework](/categories/framework)

cybercog/yii2-twittable
=======================

The twittable extension for the Yii2 framework

v0.3(11y ago)248BSD-3-ClausePHP

Since Jan 24Pushed 6y ago2 watchersCompare

[ Source](https://github.com/cybercog/yii2-twittable)[ Packagist](https://packagist.org/packages/cybercog/yii2-twittable)[ RSS](/packages/cybercog-yii2-twittable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Twittable Behavior for Yii2
===========================

[](#twittable-behavior-for-yii2)

[![Join the chat at https://gitter.im/cybercog/yii2-twittable](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/cybercog/yii2-twittable?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

This extension provides behavior functions for tweeting.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require cybercog/yii2-twittable "*"
```

or add

```
"cybercog/yii2-twittable": "*"
```

to the require section of your `composer.json` file.

Migrations
----------

[](#migrations)

If you want to auto-post News to twitter, run the following command

```
$ yii migrate/create news_tweet_link
```

Open the `/path/to/migrations/m_xxxxxx_xxxxxx_news_tweet_link.php` file,

inside the `up()` method add the following

```
$sql = "ALTER TABLE news
        ADD COLUMN tweet_id BIGINT(64) NULL DEFAULT NULL";
$this->execute($sql);
```

inside the `down()` method add the following

```
$sql = "ALTER TABLE news
        DROP COLUMN tweet_id";
$this->execute($sql);
```

Configuring
-----------

[](#configuring)

```
use cybercog\yii\twittable\behaviors\TwittableBehavior;

/**
 * ...
 * @property string $tagNames
 */
class Post extends \yii\db\ActiveRecord
{
    public function behaviors()
    {
        return [
            [
                'class' => TwittableBehavior::className(),
                'consumerKey' => 'TWITTER_CONSUMER_KEY',
                'consumerSecret' => 'TWITTER_SECRET_KEY',
                'accessToken' => 'TWITTER_ACCESS_TOKEN',
                'accessTokenSecret' => 'TWITTER_SECRET_TOKEN',
                'autoPosting' => true,
            ],
        ];
    }
}
```

Usage
-----

[](#usage)

Everything is working automatically right now. When you are creating new model - it's instantly adding a tweet.

Todo
----

[](#todo)

- Limit tags count (recomended max 3 tags per tweet)
- Configurable autoposting feature
- Configuring what to post: message, tags, url
- Handle twitter errors
- Manual posting of tweets if tweet isn't exist
- Tweets deletion
- Support Twitter cards

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

3

Last Release

4104d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3fddc40462126bbc119e373ed6a3f942a90a400f30c076c447c0625b841c4ef?d=identicon)[antonkomarev](/maintainers/antonkomarev)

---

Top Contributors

[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (15 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

twitteryii2twittable

### Embed Badge

![Health badge](/badges/cybercog-yii2-twittable/health.svg)

```
[![Health](https://phpackages.com/badges/cybercog-yii2-twittable/health.svg)](https://phpackages.com/packages/cybercog-yii2-twittable)
```

###  Alternatives

[yiisoft/yii2-twig

The Twig integration for the Yii framework

1431.9M32](/packages/yiisoft-yii2-twig)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[devanych/yii2-cart

Shopping cart for Yii2

2011.2k](/packages/devanych-yii2-cart)[tecnocen/yii2-formgenerator

Yii 2 Library to configure form generator

145.7k](/packages/tecnocen-yii2-formgenerator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
