yasmin/framework

Super fast PHP Framework for building API

1.1.17 2024-06-26 08:26 UTC

This package is auto-updated.

Last update: 2024-10-26 09:12:31 UTC


README

⚡ Super fast PHP Framework for building API

Quick Start

  1. Get this framework via composer on your project directory (inside www folder if you are using Apache)
$ composer require rsyasmin/yasmin-framework
  1. Create app/Controllers folder inside your project directory
  2. Create file HomeController.php inside app/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');
    }

}

  1. Create index.php
<?php 
require('vendor/autoload.php');

use Yasmin\Route;
Route::get('/', 'HomeController@index');

Yasmin\Framework::run();
  1. Create .htaccess file
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
  1. Edit your composer.json
{
    ...
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        }
    }
    ...
}
  1. Run composer update to update your composer autoload
  2. Done. Open http://localhost/your-project on your browser to test it