1. Download composer_setup.exe for windows
install it -> select php.exe from xampp/php/
2 Copy composer.phar from C:\ProgramData\ComposerSetup\bin [hidden folder] to D:\php\ [apache root directory]
3. type to install vendor folder [slim setups]
D:\php> php composer.phar require slim/slim
4. create your root folder (ex: test) and in your index.php..
add ../vendor/autoload.php
ex:index.php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require '../vendor/autoload.php';
$app = new \Slim\App;
$app->get('/', function (Request $request, Response $response) {
$response->getBody()->write("Welcome");
});
$app->get('/home/{name}', function (Request $request, Response $response) {
$name = $request->getAttribute('name');
$response->getBody()->write("Hello, $name");
return $response;
});
$app->run();
5. run apache and in browser http://localhost:8888/test/
install it -> select php.exe from xampp/php/
2 Copy composer.phar from C:\ProgramData\ComposerSetup\bin [hidden folder] to D:\php\ [apache root directory]
3. type to install vendor folder [slim setups]
D:\php> php composer.phar require slim/slim
4. create your root folder (ex: test) and in your index.php..
add ../vendor/autoload.php
ex:index.php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require '../vendor/autoload.php';
$app = new \Slim\App;
$app->get('/', function (Request $request, Response $response) {
$response->getBody()->write("Welcome");
});
$app->get('/home/{name}', function (Request $request, Response $response) {
$name = $request->getAttribute('name');
$response->getBody()->write("Hello, $name");
return $response;
});
$app->run();
5. run apache and in browser http://localhost:8888/test/