PHP code example of ddelnano / dredd-hooks-php
1. Go to this page and download the library: Download ddelnano/dredd-hooks-php 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/ */
ddelnano / dredd-hooks-php example snippets
use Dredd\Hooks;
Hooks::beforeAll(function(&$transaction) {
// do any necessary setup
});
use Dredd\Hooks;
Hooks::before("/test > GET", function(&$transaction) {
// do any before setup necessary
});
Hooks::before('Admin > *', function(&$transaction) {
// This will be executed for any transaction with name starting with 'Admin > '
});