An extremely light-weight and small Restful Micro-Framework MVC for Web 2.0 that doesn't get in your way, based on Symfony and ExpressJS. No Config
An extremely light-weight and small Restful Micro-Framework MVC for Web 2.0 that doesn’t get in your way, based on Symfony and ExpressJS. No Config.
// index.php
require_once('src/OnePHP/one_framework.php');
$app = new \OnePHP\App();
$app->get('/:name',function( $name ) use ( $app ){//Action
echo "Hello $name";
});
$app->listen();
1- With Composer or download Master ZIP:
composer create-project julces/oneframework
2- Include one_framework.php in your project and copy the .htaccess file in the Root Folder to use the index.php as your front controller. See file structure here for more info.
3- Run App->listen() after adding some Actions
One PHP is perfect for you if you need to quickly write small and fast Web 2.0 applications with:
1- Restful Routes
2- Easy and clean (GET, POST, PUT, DELETE…) Requests management
3- Restful Response with HTTP Status Code and custom Headers
4- PHP native Views
5- No dependencies, add extra libraries only when you need it.
1- You are building big full stack projects
2- You need big built-in libraries like Doctrine and others
$app->respond( function() use ( $app ){
return $app->ResponseHTML('<p> This is a response with code 404. </p>', 404);
});
Found a bug, need directions
or just want to say hi ?
Let me know, Fork the project, create an issue or contact me.
Follow @juliomatcom to keep up to date