PHP code example of zacksleo / yii-gitlab-error-behavior
1. Go to this page and download the library: Download zacksleo/yii-gitlab-error-behavior library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zacksleo / yii-gitlab-error-behavior example snippets
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);
}
}