July 30, 2021
Slim is a PHP micro framework that helps you quickly write simple and powerful web applications and APIs.
Essentially, Communicating HTTP requests and executing rules and returning HTTP responses.
Sample code snippet index.php
<?php
require __DIR__.'/vendor/autoload.php';
// config slim app
$config = [
'settings' => ['addContentLengthHeader' => false]
];
$app = new \Slim\App($config);
// define app
$app->get('/hello/{name}', function($request, $response, $args){
return $response->write("Hello ".$args['name']);
});
// run app
$app->run();
System Requirements:
How to Install
To install use the slim framework library use the command from composer
.
composer require slim/slim
How to Load Vendor Library
<?php
require __DIR__.'/vendor/autoload.php';
author : doctor. moeclay