An open API service indexing awesome lists of open source software.

https://github.com/mehah/slight

Framework REST for PHP
https://github.com/mehah/slight

api authentication framework framework-php light mvc php php-framework php-library rest restful router validation

Last synced: 7 months ago
JSON representation

Framework REST for PHP

Awesome Lists containing this project

README

          

# Slight Framework

Slight is an MVC framework that will assist you in the development of rest applications, containing tools for routing, authentication and validation for data models.

## Installation

You can use an already ready structure that is found here: **[Sample Project](https://github.com/mehah/Slight-project)**

Or

If you want to build your own structure, just sweat the [Composer](https://getcomposer.org/).
```shell
composer require slight.mvc/framework:dev-master
```

#### Project Structure (folders)

+ src
* config.php
* router.php

+ vendor
+ ...
+ view
* index.html
.htaccess

```.htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} ^((?!\.).)*$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?$url=$1 [QSA,L]

RewriteEngine On
RewriteCond %{REQUEST_URI} \.*$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ view/$1 [QSA,L]

RewriteEngine on
RewriteCond %{REQUEST_URI} (/src/|/vendor/|/build/)
RewriteRule ^.*$ /404 [L]
```

index.php

```php

License
-------

Slight is licensed under the MIT license.