Download the PHP package andreimosman/mvczitto without Composer
On this page you can find all versions of the php package andreimosman/mvczitto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andreimosman/mvczitto
More information about andreimosman/mvczitto
Files in andreimosman/mvczitto
Package mvczitto
Short Description Very small MVC frameworking using filesystem routing.
License MIT
Informations about the package mvczitto
MVCzitto
MVCzitto is a framework for PHP that allows you to build web applications in a simple and easy way.
Instead of traditional OO Based MVC, we decided to implement MVC using File System Routing.
The idea behing this is to write code using PHP as pure as possible, but providing some patterns and organization.
Two things motivated me to do it:
- The nextjs routing
- Rasmus Lerdorf said "PHP Frameworks all suck". I'm trying to create this fremework as less frameworky as possible.
HOWTO
Add via composer
Please refer to the Composer website for instructions on how to install it on your platform if you don't have it. Alternatively, you may also download Frameworkitto from the releases page and export it to your project's main folder.
Docker development environment
At the folder docker-dev-environment you can call firstrun.sh to create the development environment using docker compose.
Please refer to the Docker website for instructions on how to install it on your platform if you don't have it.
Getting Started with MVCzitto
The app folder contain more instructions and also few samples
Routing verbs
The verb set by default is GET but you can specify the verb at the begining of the filename inside @(), such as @(post)new.php
Authentication
The folders authenticated and open means that the route is valid on user is authenticated or not respectively.
The super simple authentication schema is:
By doing this will return true;
You can logout by calling
Check app/controllers/open/user/@(post)login.php and app/controllers/authenticated/user/logout.php
File system models
To access then on controllers you can just call $models->nameOfTheController. Check app/controllers/open/user/@(post)login.php:
It executes the snippet located at app/models/users/read.php.
The main index.php
app/index.php contains the entry point of the application and the dependency injector.
File System CLI Scripts
In the same way controllers and models works, you can create CLI commands, accessible through ./app/cli.
A few dummy examples where added to app: