Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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.

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 repository

And 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