PHP Classes

PHP Web MVC Framework: MVC framework providing autogenerated MySQL models

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (409)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-11-23 (1 month ago) RSS 2.0 feedStarStarStarStarStar 83%Total: 1,197 This week: 1All time: 3,159 This week: 108Up
Version License PHP version Categories
webmvcframework 1.0.34BSD License5PHP 5, Databases, Libraries, Design P...
Description 

Author

This package is a MVC framework providing autogenerated MySQL models.

It provides base classes for creating Web applications like controllers, models and view classes, as well as, a set of MVC components for commons database operations like search, sort, paginate etc.

It uses the paradigm of "convention over configuration" for routing the requests to appropriate subsystem/controller

It avoids the mixing of HTML code with PHP code so that Web designers and programmers can cooperate better with each other.

Picture of Saro Carvello
  Performance   Level  

 

Recommendations

Website structure
I need a basis structure to build my website

What is the best PHP request routing class?
I want to route my PHP HTML templates for easy navigation

Example

<?php
/**
 * index.php
 *
 * This file is automatically invoked after every URL request and only when the rewrite
 * conditions defined into the .htaccess file are satisfied
 * It provides the auto loading of classes and the MVC objects creations, by using
 * framework\Loader and framework\Dispatcher classes, depending on the requested URL.
 *
 * Note:
 * You can also use this file as header template for building your own PHP file based script
 * containing code that use Web MVC Framework classes.
 * For this purpose simply comment out each line of code that contain a Dispatcher use.
 *
 * @filesource index.php
 * @author Rosario Carvello <rosario.carvello@gmail.com>
 * @version GIT:v1.0.0
 * @copyright (c) 2016-2023 Rosario Carvello <rosario.carvello@gmail.com> - All rights reserved. See License.txt file
 * @license BSD Clause 3 License
 * @license https://opensource.org/licenses/BSD-3-Clause This software is distributed under BSD-3-Clause Public License
 *
 */

/* Path of this script */
define ("RELATIVE_PATH", "");

/* Enable error reporting and disable notices */
error_reporting(E_ALL & ~E_NOTICE);
// error_reporting(E_ALL);
// ini_set('display_errors', '1');

/*
  Commons initializations and configurations loading
  Note: To change framework or application setting see the config folder.
*/

header('Content-Type: text/html; charset=utf-8');
include_once(
RELATIVE_PATH . "config/framework.config.php");

/* Starting and securing session */
session_start();
session_regenerate_id(true);

/* Use of framework classes */
use framework\Loader;
use
framework\Dispatcher;

/* Set classes auto loader simply by instantiating framework Loader */
$loader = new Loader();

/* Create a dispatcher for handling URL request to the appropriate user controller */
$dispatcher = new Dispatcher();
$dispatcher->dispatch();




Details

alt tag <sup>Supported PHP versions from 5.3 to 8.2</sup> > > Quality Gate Status Vulnerabilities Bugs Maintainability Rating Reliability Rating

PHP WEB MVC Framework

The package webmvcframework, with the acronym of WebMVC, is an object oriented PHP framework designed using MVC architectural pattern for building web-based MySQL applications.

It is s an open-source web framework purposely wrote for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring Convention over Configuration paradigm. The result is a web framework that allows you to transition from idea to implementation in a very short period of time.

It offers to developers a complete set of functionalities for rapid development of data intensive web applications. Generally, it provides services for system decomposition that developers can do at different levels when they coding a complex web application. Firstly it provides the classes to achieve the Model, View, Controller decomposition and also to divide PHP code from HTML during the GUI designing. However, this is not the only feature provided by the Framework for acting on the application's decomposition.

The Component Based Development, that was used for building many framework?s features, permits to developers to apply another level of software decomposition and reuse. Framework?s components, in fact, realize recurrent aspects of web applications. Many of these aspects are regarding MySQL, e.g. data listing, data listing and sorting, data listing and filtering, data listing and pagination, record management and the common table?s operations of select, insert, delete and update.

> WebMVC offers a set of pre-built components for implementing the necessary server logic for frequently database management operations. Each component is itself designed with an MVC architecture and is equipped by a Controller, Model, View, and HTML Template. Components are easy to use and developers can aggregate them into a root controller by using composition criteria when building complex web pages. The component GUI can also easily updated or replaced to reflect the graphics experience, simply by editing or replacing the component HTML template. The component internal logic will remain fully reusable without the need for any source code modifications.

Thanks

Many and many thanks to

https://www.jetbrains.com for granting me an open source license of magic

https://www.jetbrains.com/phpstorm/ PHPStorm


that I used in the development of PHP Web MVC Framework.

How to install

To install the framework download and copy it into an Apache web folder. Then go to the config directory and modify application.config.php according to your MySQL server configuration and Apache web folder you want to use for your application. By default framework provides a small set of examples. For using them run the provided SQL script into the sql folder. In a future time, I will provide you with more examples illustrating its functionalities.

How to autogenerate PHP Model classes from your MySQL database

The util directory contains a file named app_create_beans.php. Run it from your browser or from command line for executing ORM classes code auto generation regarding tables of a given MySQL database.

Warning ! Before running it you must configure MySQL access parameters by modifying util\mysqlreflection\mysqlreflection.config.php according to your MySQL configuration. After running the utility you will find the autogenerated PHP classes into the models\beans directory.

Documentation

WebMVC official wiki

You can start reading the wiki from here

Other information

You can dowload some PDFs, PPTs, and diagrams from here

Video Tutorial

An introduction to PHP WebMVC Framework

IMAGE Video Tutorial

Diagrams

Main classes

alt tag

Handling HTTP requests - Loading and dispatching controllers

alt tag

alt tag

The flow description is the following; 1. An incoming HTTP request is delivered to the Web MVC Dispatcher 2. The Dispatcher automatically recognizes in the HTTP request a call for a Controller execution. Then it uses the Loader to load the appropriate Controller class. 3. The Loader imports Controller class and all its dependencies 4. The Dispatcher is now enabled to instantiate the appropriate Controller * 4b...z Its also possible that the Controller aggregates and manages the execution of one or more controllers. This is a feature of WebMVC known as "Hierarchical MVC". We will discuss it later, in this section 5. The Controller uses and runs the Model * 5b Model connects to MySQL to retrieve or store data 6. The Controller uses and runs the View * 6b The View reads the static design of the web page from an HTML Template. The static design of the Template will be used by the View for generating the dynamic web page also by using data provided by the Model. 7. The Controller, after loading and processing the Model and View, is enabled to provide back to the Dispatcher the output that was dynamically produced. 8. Finally, the Dispatcher sends back the output as an HTTP response


Screenshots  
  • Image1
Videos  
  • PHP Web MVC Framework
  • Web MVC Framework
  Files folder image Files  
File Role Description
Files folder image.idea (6 files)
Files folder imageclasses (1 file)
Files folder imageconfig (7 files)
Files folder imagecontrollers (3 files, 3 directories)
Files folder imagecss (3 directories)
Files folder imagedocs (15 files, 1 directory)
Files folder imageframework (16 files, 6 directories)
Files folder imageimgs (4 files)
Files folder imagejs (5 files, 6 directories)
Files folder imagelocales (1 file, 2 directories)
Files folder imagemodels (2 files, 4 directories)
Files folder imagesql (1 file)
Files folder imagetemplates (2 files, 3 directories)
Files folder imageutil (4 files, 2 directories)
Files folder imageviews (2 files, 3 directories)
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file examples_instructions.txt Doc. Documentation
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file license.txt Doc. Documentation
Accessible without login Plain text file manifest.webmanifest Data Auxiliary data
Accessible without login Plain text file mvc_bootstrap.bat Data Auxiliary data
Accessible without login HTML file my_rest_gui.html Doc. Documentation
Accessible without login Plain text file readme.md Doc. Documentation
Accessible without login Plain text file readme_old.md Doc. Documentation
Accessible without login Plain text file route.php Example Example script
Accessible without login Image file spinner.gif Icon Icon image
Accessible without login Plain text file _config.yml Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 99%
Total:1,197
This week:1
All time:3,159
This week:108Up
User Ratings User Comments (1)
 All time
Utility:95%StarStarStarStarStar
Consistency:95%StarStarStarStarStar
Documentation:87%StarStarStarStarStar
Examples:95%StarStarStarStarStar
Tests:-
Videos:80%StarStarStarStarStar
Overall:83%StarStarStarStarStar
Rank:8