«   2018/06   »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Archives
Today
340
Total
1,112,200
안정적인 DNS서비스 DNSEver
관리 메뉴

Blue Breeze

PHP Slim Framework helloWorld 본문

Language/PHP

PHP Slim Framework helloWorld

푸른바람 C/H 2018.06.07 18:07

Slim은 간단하면서도 강력한 웹 응용 프로그램과 API를 신속하게 작성하는 데 도움이되는 PHP 마이크로 프레임 워크입니다.

Download & Install

#php composer.phar create-project slim/slim-skeleton [my-app-name]
composer create-project slim/slim-skeleton slim
cd slim
cat public/index.php
php -S localhost:8080 -t public public/index.php
<?php
if (PHP_SAPI == 'cli-server') {
    // To help the built-in PHP dev server, check if the request was actually for
    // something which should probably be served as a static file
    $url  = parse_url($_SERVER['REQUEST_URI']);
    $file = __DIR__ . $url['path'];
    if (is_file($file)) {
        return false;
    }
}

require __DIR__ . '/../vendor/autoload.php';

session_start();

// Instantiate the app
$settings = require __DIR__ . '/../src/settings.php';
$app = new \Slim\App($settings);

// Set up dependencies
require __DIR__ . '/../src/dependencies.php';

// Register middleware
require __DIR__ . '/../src/middleware.php';

// Register routes
require __DIR__ . '/../src/routes.php';

// Run app
$app->run();


0 Comments
댓글쓰기 폼