All Projects → sebbekarlsson → PHPFlask

sebbekarlsson / PHPFlask

Licence: other
🍶 Flask for PHP

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to PHPFlask

fir
Fir. A lightweight PHP MVC Framework.
Stars: ✭ 33 (+120%)
Mutual labels:  mvc, php-framework
app
Aplus Framework App Project
Stars: ✭ 338 (+2153.33%)
Mutual labels:  mvc, routing
velox
The minimal PHP micro-framework.
Stars: ✭ 55 (+266.67%)
Mutual labels:  mvc, php-framework
Leaf
🍁 The easiest way to create clean, simple but powerful web apps and APIs quickly
Stars: ✭ 248 (+1553.33%)
Mutual labels:  mvc, php-framework
W
Framework pédagogique de la WebForce3
Stars: ✭ 10 (-33.33%)
Mutual labels:  mvc, php-framework
template-injection-workshop
Workshop on Template Injection (6 exercises) covering Twig, Jinja2, Tornado, Velocity and Freemaker engines.
Stars: ✭ 99 (+560%)
Mutual labels:  twig, jinja2
framework
Aplus Full-Stack Framework
Stars: ✭ 172 (+1046.67%)
Mutual labels:  mvc, routing
Imi
imi 是基于 Swoole 的 PHP 协程开发框架,它支持 Http、Http2、WebSocket、TCP、UDP、MQTT 等主流协议的服务开发,特别适合互联网微服务、即时通讯聊天im、物联网等场景!。QQ群:17916227
Stars: ✭ 680 (+4433.33%)
Mutual labels:  mvc, php-framework
OwOFrame
A lightweight MVC framework for PHP
Stars: ✭ 46 (+206.67%)
Mutual labels:  mvc, php-framework
Lightweight-PHP-Framework-For-Web-and-APIs
Simple PHP framework that helps you quickly understand and write simple APIs.
Stars: ✭ 24 (+60%)
Mutual labels:  mvc, php-framework
Elefant
Elefant, the refreshingly simple PHP CMS and web framework.
Stars: ✭ 188 (+1153.33%)
Mutual labels:  mvc, routing
startmvc
超轻量php框架 lightweight php framework
Stars: ✭ 25 (+66.67%)
Mutual labels:  mvc, php-framework
Php Msf
PHP微服务框架即Micro Service Framework For PHP
Stars: ✭ 1,764 (+11660%)
Mutual labels:  mvc, php-framework
Lumberjack
Lumberjack is a powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code.
Stars: ✭ 261 (+1640%)
Mutual labels:  twig, mvc
Miniphp
A small, simple PHP MVC framework skeleton that encapsulates a lot of features surrounded with powerful security layers.
Stars: ✭ 144 (+860%)
Mutual labels:  mvc, php-framework
Polyel-Framework
⚡️ Voltis Core: A PHP framework based on Swoole from the ground up
Stars: ✭ 22 (+46.67%)
Mutual labels:  mvc, php-framework
miniPHP
A small, simple PHP MVC framework skeleton that encapsulates a lot of features surrounded with powerful security layers.
Stars: ✭ 147 (+880%)
Mutual labels:  mvc, php-framework
Koseven
Koseven a Kohana fork compatible with PHP7
Stars: ✭ 332 (+2113.33%)
Mutual labels:  mvc, php-framework
framework
Cygnite PHP Framework- A Modern Toolkit For Web Developers
Stars: ✭ 43 (+186.67%)
Mutual labels:  twig, routing
leafMVC
MVC "Framework" created from Leaf PHP Framework
Stars: ✭ 25 (+66.67%)
Mutual labels:  mvc, php-framework

Flask for PHP!

Supports:

  • Blueprints
  • Function routes
  • Jinja-like templating (Using Twig)

Requirements:

  • PHP 5.6 and above
  • Composer

About

The goal of this project is to be able to write flask-like applications in PHP.

Installation

Clone down the repository inside your project (preferably as a submodule)

And then:

    cd PHPFlask/
    composer install

And then in your project:

    require_once('PHPFlask/src/index.php');

Installing with composer

You can also install using composer:

    composer install sebbekarlsson/php-flask

Full installation guide

Still clueless?

Read the full installation guide

Blueprint example:

    class FruitsBP extends Blueprint {
        var $fruits;
        
        function __construct() {
            parent::__construct();

            $this->base_url = '/fruits';

            $this->route('/', 'main');
        }

        function init() {
            $this->fruits = [
                'apple',
                'banana',
                'raspberry',
                'papaya',
                'orange'
            ];
        }

        function main() {
            return json_encode($this->fruits);
        }
    }

And then registering it:

    $app->register_blueprint(new FruitsBP());

Function example:

    $app->route('/fruits', function() {
        return json_encode([
            'apple',
            'banana',
            'raspberry',
            'papaya',
            'orange'
        ]); 
    });
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].