longanime / webx
Light php framework to illustrate the implementation of a web framework with static routes for study purposes
Requires
- php: ^7.2
README
Welcome to Webx (tiny) php framework
Tiny and simple framework to illustrate an implementation of a web framework with static routes using Php | Study purposes for programming classes.
This was a design POC architecture for academic use forged as a gift for a friend teaching classes in web programming.
You may use it as it is. There is no plan on continuing this project (well...who knows in the future!)
Feel free to send comments.
Installation
composer require longanime/webx
Architectre
Simple View-Controller (no model) with static route approach.
Folder structure:
|-app/ root folder of your application |--actions/ your actions classes |--view/ your view classes (matching actions' names) |-actions.php Build your actions and rounting |-app.php Your application configuration |-index.php App caller
Usage
Create an app.php
file in your root folder and inialize a new App.
$app = new App( "app-name" );
You can create your actions/rountings direct inside the app.php
file or you could create an actions.php
file and inside of it require individual controllers (no enforced, for now).
When creating, for each action it will seek for
- an action class: a file under /app/actions/[ActionName].class.php
- a view: a file under /app/views/[ActionName].php
If the action does not needs a view, just create the class file under (1)
There is an example app called webx-app available on github.
Support or Contact
You can reach me at michael at malvins dot studio
Good Coding!