Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adzialocha/kleiner
Simple PHP Web Framework
https://github.com/adzialocha/kleiner
orm php-framework router
Last synced: 19 days ago
JSON representation
Simple PHP Web Framework
- Host: GitHub
- URL: https://github.com/adzialocha/kleiner
- Owner: adzialocha
- License: mit
- Created: 2019-03-08T16:36:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-17T09:05:20.000Z (over 5 years ago)
- Last Synced: 2024-11-05T12:12:40.595Z (2 months ago)
- Topics: orm, php-framework, router
- Language: PHP
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Kleiner
---Very simple PHP >=7.1 web framework based on [medoo](https://medoo.in/) and [altorouter](https://altorouter.com/).
## Usage
```php
namespace MyPage;use Kleiner;
$config = [
'env' => 'production',
'db' => [
'database_type' => 'mysql',
'database_name' => '',
'server' => 'localhost',
'username' => '',
'password' => ''
],
'assetsPath' => '/dist/',
'basePath' => '/',
'baseUrl' => 'https://www.mypage.com'
];$routes = [
[
'path' => '/admin/[pages|users]?',
'controller' => 'Admin\AdminController',
'action' => 'index',
],
];$app = new Kleiner(__DIR__ . '/views/', $config);
$app->setupRoutes('MyPage\Controllers\\', $routes);
echo $app->dispatch();
``````php
isAuthenticated($service, $request, $response);$data = [
'url' => $this->config['baseUrl'],
'isAuthenticated' => $isAuthenticated,
];$service->render('admin.php', $data);
}
}
```## License
MIT