All Projects → santoshbaggam → Php Mini Framework

santoshbaggam / Php Mini Framework

PHP mini framework

Projects that are alternatives of or similar to Php Mini Framework

Zen
zen is a elegant and lightweight web framework for Go
Stars: ✭ 257 (+295.38%)
Mutual labels:  framework, mvc
Iris
The fastest HTTP/2 Go Web Framework. AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. A true successor of expressjs and laravel | 谢谢 https://github.com/kataras/iris/issues/1329 |
Stars: ✭ 21,587 (+33110.77%)
Mutual labels:  framework, mvc
Jsblocks
Better MV-ish Framework
Stars: ✭ 2,795 (+4200%)
Mutual labels:  framework, mvc
Elefant
Elefant, the refreshingly simple PHP CMS and web framework.
Stars: ✭ 188 (+189.23%)
Mutual labels:  framework, mvc
Furion
Make .NET development easier, more versatile, and more popular.
Stars: ✭ 902 (+1287.69%)
Mutual labels:  framework, mvc
Quiz App
A repository reflecting the progress made on the "How to Build iOS Apps with Swift, TDD & Clean Architecture" YouTube series, by Caio & Mike.
Stars: ✭ 230 (+253.85%)
Mutual labels:  framework, mvc
Wpemerge
A modern, MVC-powered WordPress as a CMS workflow. 🚀
Stars: ✭ 348 (+435.38%)
Mutual labels:  framework, mvc
Ihp
🔥 The fastest way to build type safe web apps. IHP is a new batteries-included web framework optimized for longterm productivity and programmer happiness
Stars: ✭ 2,746 (+4124.62%)
Mutual labels:  framework, mvc
Latke
🌀 一款以 JSON 为主的 Java Web 框架。
Stars: ✭ 781 (+1101.54%)
Mutual labels:  framework, mvc
Lux
Build scalable, Node.js-powered REST JSON APIs with almost no code.
Stars: ✭ 556 (+755.38%)
Mutual labels:  framework, mvc
Woowahanjs
웹 어플리케이션 개발을 위한 JS프레임워크
Stars: ✭ 171 (+163.08%)
Mutual labels:  framework, mvc
Bast
Simple but Elegant Web Framework
Stars: ✭ 49 (-24.62%)
Mutual labels:  framework, mvc
Lad
👦 Lad is the best Node.js framework. Made by a former Express TC and Koa team member.
Stars: ✭ 2,112 (+3149.23%)
Mutual labels:  framework, mvc
Leaf
🍁 The easiest way to create clean, simple but powerful web apps and APIs quickly
Stars: ✭ 248 (+281.54%)
Mutual labels:  framework, mvc
Mandarinets
Mandarine.TS is a typescript, decorator-driven framework that allows you to create server-side applications. Mandarine.TS provides a range of built-in solutions such as Dependency Injection, Components, ORM and more. Under its umbrella, Mandarine.TS has 4 modules: Core, Data, Security and MVC, these modules will offer you the requirements to build a Mandarine-powered application.
Stars: ✭ 161 (+147.69%)
Mutual labels:  framework, mvc
Cppwebframework
​The C++ Web Framework (CWF) is a MVC web framework, Open Source, under MIT License, using C++ with Qt to be used in the development of web applications.
Stars: ✭ 348 (+435.38%)
Mutual labels:  framework, mvc
Miniphp
A small, simple PHP MVC framework skeleton that encapsulates a lot of features surrounded with powerful security layers.
Stars: ✭ 144 (+121.54%)
Mutual labels:  framework, mvc
Carry
ClojureScript application framework.
Stars: ✭ 149 (+129.23%)
Mutual labels:  framework, mvc
Ubiquity
Ubiquity framework
Stars: ✭ 480 (+638.46%)
Mutual labels:  framework, mvc
Recife
A powerful MVC Framework for GraphQL
Stars: ✭ 20 (-69.23%)
Mutual labels:  framework, mvc

Intro

A mini PHP framework built from scratch following the latest PSR standards.

The framework includes concepts like:

Routing

routes.php

You can make GET, POST, PUT, DELETE, or any HTTP route.

// GET
$app->get('users', ['UsersController', 'index']);

// POST
$app->post('users', ['UsersController', 'store']);

Responses

You can return HTML views, JSON, or any other content type either from Controllers or by using anonymoues functions.

# return html view
$app->get('/', ['PagesController', 'home']);

# return json
$app->get('users', ['UsersController', 'index']);

# return plain text
$app->get('status', function ($app) {
	return '<pre> I\'m OK </pre>';
});

Container

The app container file is located at app/Core/Container.php.

You can bind items to the app within bootstrap/app.php using the following array syntax.

$app->bind('databaseConnection', [new App\Core\Database\Connection, 'make']);

The first item in the array is the instance of the class you want to bind and the second is the method to invoke.

And to simply resolve items out of the container:

$db = $app->databaseConnection;

Dependency Injection

Checkout app/Core/App.php and app/Core/Database/Connection.php to understand that the container object is automatically injected into its bindings. Here the binding is databaseConnection.

class Connection
{
	/*
	 * App\Core\Container $container is injected 
	 * automatically by $app (bind)
	 */
    public function make($container)
    {
    	//
    }
}

The following code within app/Core/Database/QueryBuilder.php shows that we're injecting the PDO dependency into the Connection class.

public function __construct(PDO $connection)
{
    $this->connection = $connection;
}

Closures

Apart from the array syntax, you can also bind items to the app by passing a closure as the second argument, within bootstrap/app.php

$app->bind('database', function ($app) {
	return new App\Core\Database\QueryBuilder($app->databaseConnection);
});

And more

The framework includes many other concepts like MVC, front-controller pattern, collections, models, custom config file, etc.

Installation

Simply clone and install by:

composer install

And bootup the server by running:

php -S localhost:8080 -t public/

Note that the framework is not to be used for real projects. Built to understand the inner workings of popular frameworks in a simplistic way!

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].