Download the PHP package robertwesner/simple-mvc-php without Composer
On this page you can find all versions of the php package robertwesner/simple-mvc-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download robertwesner/simple-mvc-php
More information about robertwesner/simple-mvc-php
Files in robertwesner/simple-mvc-php
Package simple-mvc-php
Short Description A small library for creating PHP web servers.
License MIT
Informations about the package simple-mvc-php
Simple MVC for PHP



[](../../raw/main/LICENSE.txt)
A small library for creating PHP web servers.
Use case: Serving semi-static content; not intended for large scale sites with complex logic.
Initially created for private use in place of Node-JS when creating very simple websites. Feel free to use if it fits your needs.
Websites using this:
Features
- Request handling (
GET
,POST
,PUT
,PATCH
,DELETE
)- Query parameters
- JSON parameters
- URI parameters
- Intuitive Syntax
- Simple to use composer template
- Integrated Twig templating engine
Installation
New project
This creates a new project with the required folder structure and is the preferred way of use.
Existing project
If you already have a project, require the package and migrate your files manually.
Configuration
nginx
All traffic except for "/public" should be redirected to "/route.php".
Below is a Nginx sample configuration running under Docker.
Usage
Project structure
Routing scripts
You can create any amount of routing scripts. They define a mapping between a URL and a controller function or method.
Example:
api.php
view.php
Using Controller Classes
More complex Logic can be handled with class controllers.
Note: This is not recommended. Complex applications should use more sophisticated frameworks.
See: demo routing