yasmin / framework
Super fast PHP Framework for building API
1.1.17
2024-06-26 08:26 UTC
README
⚡ Super fast PHP Framework for building API
Quick Start
- Get this framework via composer on your project directory (inside www folder if you are using Apache)
$ composer require rsyasmin/yasmin-framework
- Create
app/Controllers
folder inside your project directory - Create file
HomeController.php
insideapp/Controllers
with this content
<?php
namespace App\Controllers;
use Yasmin\Controller;
class HomeController extends Controller {
function __construct() {
parent::__construct();
}
function index() {
return response('Welcome to Yasmin Framework');
}
}
- Create index.php
<?php
require('vendor/autoload.php');
use Yasmin\Route;
Route::get('/', 'HomeController@index');
Yasmin\Framework::run();
- Create
.htaccess
file
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
- Edit your composer.json
{
...
"autoload": {
"psr-4": {
"App\\": "app/"
}
}
...
}
- Run
composer update
to update your composer autoload - Done. Open
http://localhost/your-project
on your browser to test it