webengine / flask-php
dev-master
2016-12-19 05:27 UTC
Requires
- php: >=5.4
- twig/twig: v1.24.1
This package is not auto-updated.
Last update: 2025-01-18 21:15:34 UTC
README
PHP Library like Flask of Python
How to Use
Server Settings
Apache: .htaccess
create .htaccess file at same directory to index.php and write:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php/$1 [L]
IIS
not ready yet.
NGINX
not ready yet.
Install
composer install webengine/flask-php
Cannot use without composer
Example Code
<?php
use FlaskPHP\FlaskPHP;
$app = new FlaskPHP();
$app->route('/index', function () {
return 'This is index.';
});
$app->get('/members/<name>',
function($name) {
return render_php('/pages/members.php', ['name' => $name]);
});
$app->post('/members/<name>',
function($name) {
return render_twig('/pages/members.twig', ['name' => $name]);
});