zacksleo/yii-gitlab-error-behavior

yii2 error behavior for gitlab

1.0.6 2017-04-29 16:20 UTC

This package is auto-updated.

Last update: 2024-11-08 07:26:03 UTC


README

gitlab error behavior for yii1

Latest Stable Version Total Downloads License

Usage

Install By Composer

  composer require zacksleo/yii-gitlab-error-behavior --prefer-dist 
  

set component

    'errorHandler' => [
        'errorAction' => 'site/error',
    ],

set behavior in SiteController

set apiRoot, privateToken and projectName

    public function behaviors()
    {
        return array(
            'error' => array(
                'class' => 'webroot.vendor.zacksleo.yii-gitlab-error-behavior.src.ErrorBehavior',
                'apiRoot' => 'http://gitlab.com/api/v3/',
                'privateToken' => '{privateToken}',
                'projectName' => '{demo/project}'
            )
        );
    }   
    
    public function onBeforeAction($event)
    {
        $this->raiseEvent('onBeforeAction', $event);
    }    


    public function actionError()
    {
        if ($error = Yii::app()->errorHandler->error) {
            $this->onBeforeAction(new CEvent($this));            
            $this->renderPartial('error', $error);            
        }
    }

Screenshoot