Nice

A framework for PHP 5.4+

Nice integrates FastRoute with Symfony 2 components to provide a stable, fast base for your application.

<?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Nice\Application;
use Nice\Router\RouteCollector;

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

$app = new Application();
$app->set('routes', function (RouteCollector $r) {
    $r->map('/', 'home', function (Request $request) {
        return new Response('Hello, world');
    });
});
$app->run();

Prototype quickly

Nice is designed to be easy to get up and running. Throw together a dynamic website in just a matter of minutes. Installation is as simple as:

composer require nice/framework:~1.0

Discard nothing

Nice utilizes Symfony's Dependency Injection and Config components, providing powerful configuration options. Prototypes are no longer throwaway work, instead growing to become stable, maintainable applications.


Leverage the HttpKernel

Nice is built on top of Symfony's HttpKernel. Combine Nice with HttpKernel middlewares to quickly and cleanly separate your application into logical layers.


Expand your application

  • Make use of extensions that integrate Doctrine DBAL, Doctrine ORM, Twig, Monolog, and many more.
  • Secure your application with basic username/password authentication, or easily implement API authentication tokens.
  • Write your own dependency injection extensions and compiler passes to harness the power of the Symfony DIC.

Check out the examples

From toy websites to actually-useful-things, we've got a small showcase of Nice projects. Check them out!