1. Go to this page and download the library: Download goldencodeio/restify-shop 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/ */
goldencodeio / restify-shop example snippets
Bitrix\Main\Event;
use Bitrix\Main\EventManager;
use Emonkak\HttpException\InternalServerErrorHttpException;
EventManager::getInstance()->addEventHandler(
'spaceonfire.restify',
'transform',
'modifyStatusCode'
);
function throw500() {
throw new InternalServerErrorHttpException();
}
function modifyStatusCode(Event $event) {
$params = $event->getParameters();
$params['statusCode'] = 500;
}