1. Go to this page and download the library: Download tcdev/macaw 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/ */
Macaw::get('/(:any)', function($slug) {
echo 'The slug is: ' . $slug;
});
Macaw::dispatch();
Macaw::get('/', function() {
echo 'I <3 GET commands!';
});
Macaw::post('/', function() {
echo 'I <3 POST commands!';
});
Macaw::dispatch();
Macaw::haltOnMatch(true); // This will prevent further execution once a match is found
Macaw::get('/', function() {
echo 'Hello world!';
});
Macaw::dispatch();
echo 'I am further execution...';
Macaw::setMethod('POST');
Macaw::error(function() {
echo '404 :: Not Found';
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.