Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kliksob/klikflight
KlikFlight The Flight MicroFramework Application With MVC Architecture. Inspired By CodeIgniter MVC Patern.
https://github.com/kliksob/klikflight
composer flightphp mvc mvc-framework php restfull
Last synced: 22 days ago
JSON representation
KlikFlight The Flight MicroFramework Application With MVC Architecture. Inspired By CodeIgniter MVC Patern.
- Host: GitHub
- URL: https://github.com/kliksob/klikflight
- Owner: kliksob
- License: mit
- Created: 2018-02-10T03:27:25.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-10T05:33:22.000Z (almost 7 years ago)
- Last Synced: 2025-01-12T22:40:45.471Z (22 days ago)
- Topics: composer, flightphp, mvc, mvc-framework, php, restfull
- Language: PHP
- Homepage: https://kliksob.net
- Size: 61.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is my first project.
# Welcome to my new repository.
KlikFlight is a Web Application Framework based on Flight Micro Framework That is very light for a small website and very good for restfull applications.
## How to Use.
There are two options for you when you want to install this application for your project.
### The first way.
This is the way I recommend.
Use Composer Autoloader.Type in your terminal.
```shell
$~ composer require kliksob/klikflight
$~ composer update
```
Create index.php File in your public root Directory.
```php
start();
```### The second way.
Download this repositoryAnd Change index.php File
Please Uncomment
```php
// require_once APPPATH. '/src/vendor/autoload.php';
```And Add a comment on the line
```php
require_once APPROOT. '/vendor/autoload.php';
```This will work without Composer. Recommended for small projects.
#### Configuration
/app/config.php```php
return [
/* Basic Config */
'config' => [
],
/* Framework Config */
'framework' => [
'default.index' => 'index',
'case_sensitive' => false,
'views.path' => APPPATH. '/view/',
'views.extension' => '.php',
'model.prefix' => '_model',
'helper.prefix' => '_helper',
'library.prefix' => '_lib',
'base_url' => '',
'handle_errors' => true,
'log_errors' => true
]
];
```#### Routing
/app/route.php```php
/**
* Object Method Routing
*/$home = new HomeController();
Flight::routeGet('/', array($home, 'index'));
Flight::routeGet('/flight', array($home, 'getFlightInstance'));
Flight::routeGet('/test(/*)', array($home, 'test'));/**
* Static Method Routing
*/class RouteStatic{
static function example(){
echo 'Hello Static';
}
}
Flight::route('/static', array('RouteStatic', 'example'));// For Specific Method
//Flight::routeAny($route, $callback);
//Flight::routeGet($route, $callback);
//Flight::routePost($route, $callback);
//Flight::routePut($route, $callback);
//Flight::routePatch($route, $callback);
//Flight::routeDelete($route, $callback);
//Flight::routeHead($route, $callback);
//Flight::routeTrace($route, $callback);
//Flight::routeOptions($route, $callback);/**
* Controller Method Routing pass All Public Class Object Method
* Static Method Does't Work.
*/Flight::routeController('/blog', 'TestController');
/**
* Regular Method Routing
*/Flight::route('/regular', function(){
echo '';
print_r(Flight::app());
});
```Added by me. And the following features are not in the flight framework.
For More Information About Routing Engine Please See http://flightphp.com/learn/#routing#### Using Flight::routeController();
```php