davidecesarano/embryo-framework

2.0.0-beta 2019-03-27 10:41 UTC

README

Embryo is a simple PHP framework for building web applications.

require 'vendor/autoload.php';

$app = new Embryo\Application;

$app->get('/', function ($request, $response) {
    return $response->write('Hello World!');
});

$app->run();

Features

PSR Support

Embryo support PSR-7 HTTP Message, PSR-17 HTTP Factories, PSR-15 HTTP Server Request Handlers and PSR-11 Container.

HTTP Router

Embryo provides a PSR compatible router that maps route callbacks to specific HTTP request methods and URIs. It supports parameters and pattern matching. See Embryo Routing.

Middleware

Embryo uses Middleware to manipulate the Request and Response object of application. Embryo support middlewares that implement PSR-15 HTTP Handlers. See Embryo Middleware.

Dependency Injection

Embryo uses a dependency container to create, manage ad inject application dependencies. Embryo support containers that implement PSR-11 Container Interface. See Embryo Container

Requirements

  • PHP >= 7.1
  • URL Rewriting

Installation

Using Composer:

$ composer require davidecesarano/embryo-framework 2.*

Example

You may quickly test this using the built-in PHP server:

$ cd example
$ php -S localhost:8080

Going to http://localhost:8080 will now display "Hello World!".

Application

The easiest way to start working with Embryo is to create a project using Embryo Skeleton Application as a base.