2017 © Pedro Peláez
 

yii2-extension yii2-pushall-logger

Yii2 pushall.ru logger

image

fgh151/yii2-pushall-logger

Yii2 pushall.ru logger

  • Monday, February 6, 2017
  • by fgh151
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 pushall.ru

Yii2 pushall.ru module, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist fgh151/yii2-pushall "*"

or add, (*4)

"fgh151/yii2-pushall": "*"

to the require section of your composer.json file., (*5)

Add to params file:, (*6)

'PushallFeedId' => 111 //Your feed id. It mast be integer,
'PushallKey' => 'Your feed key',

Usage

Logs

How to get feed id and key see documentation, (*7)

Add to config file pushall log target. For example in /config/main.php, (*8)

[
    'bootstrap' => ['log'],
    'components' => [
        'log' => [
            'targets' => [
                [
                    'class' => 'fgh151\pushall\PushallTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
    ],
]

Behavior

You can add behavior to model, that will send message after model save. Example: in model class add, (*9)

 /**
     * @return array
     */
    public function behaviors()
    {
        return [
            'class' => fgh151\pushall\PushallBehavior::className(),
            //Attribute that contain title
            'titleAttribute' => 'title', 
            //Attribute that contain text message
            'messageAttribute' => 'intro', 
            //Optional. String that contain full url to view page
            'url' => Yii::$app->urlManager->createAbsoluteUrl(['controller/view', 'id' => $this->id]),
            //Optional. Contain custom feed id. If not set use from params
            'feedId' => 0000,
            //Optional. Contain custom feed key. If not set use from params
            'feedKey' => 'Your feed key',
            //Optional. Chanel type. Defaul broadcast.
            //Can be: broadcast, unicast, self
            'chanelType' => 'broadcast'
        ];
    }

The Versions

06/02 2017

dev-master

9999999-dev

Yii2 pushall.ru logger

  Sources   Download

MIT

The Requires

 

extension yii2