2017 © Pedro Peláez
 

library mini-php

This is a mini PHP Restful framework

image

minhsieh/mini-php

This is a mini PHP Restful framework

  • Wednesday, June 27, 2018
  • by minhsieh
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

MiniPHP API framework

這是一個練習開發的API Framework,之前要開發一個PHP的RestfulAPI都會選擇使用Laravel,但由於Laravel太過於龐大,並不是每個專案都適用,所以自己嘗試開發一個比較簡易使用的PHP API Framework., (*1)


Install

With Composer, (*2)

composer require minhsieh/mini-php

Basic Usage

require "vendor/autoload.php";

use MiniPHP\App;

$app = new App;

# Normal Get
$app->get('/', function() use($app){
    echo "

Hello World

This is index"; }); # Get URI input $app->get('/:name', function($name) use($app){ echo "Hello $name"; }) # Json Response $app->get('/json', function() use($app){ $app->json(['foo' => 'bar']); }); # Response to all other $app->respond( function() use ( $app ){ return $app->html('

We have a problem , (*3)

', 404); }); $app->listen();

Apache2 .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

The Versions

27/06 2018

dev-master

9999999-dev http://imin.tw

This is a mini PHP Restful framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

api framework php http restful