Tutorial by Examples

Recommended way to install Slim framework is by using composer. Create an empty directory This directory will contain all required files for our Slim application to run. We call this directory root directory so we can address all other application files and directories relative to root directo...
Installation or Setup Slim framework Install Composer Open cmd Go to Root directory of your Project Folder and Run Following Command. composer require slim/slim "^3.0" Now you will have vendor directory in your project Next Create Index.php in root folder and add following co...
use \Psr\Http\Message\ServerRequestInterface as Request; use \Psr\Http\Message\ResponseInterface as Response; require 'vendor/autoload.php'; $app = new \Slim\App; $app->get('/employee/view', function ($req, $res) { $con = new mysqli('localhost','USERNAME','PASSWORD','DATABASE'); ...
<?php include "vendor/autoload.php"; $app = new \Slim\App(); $app->get('/hello', function () { echo "Hello, world"; }); $app->run();
Depending on whether you have installed composer globally or locally. Locally: php composer.phar create-project slim/slim-skeleton {my-app-name} Globally: composer create-project slim/slim-skeleton {my-app-name} If you are running a webserver (ex. Apache or nginx) point your virtualho...

Page 1 of 1