myMVC - A PHP-Framework implementing the MVC-paradigm
myMVC is a PHP-Framework to implement the MVC-paradigm (Model-View-Controller).
This system allows a complete separation between the logic (Model) and the display of the data (View).
The Controller will manage the communication between these elements.
For every page of the program will then exist two or more files:
- An "Action-class" with the whole logic to check the user data and to manage them (search/insert/delete in the database, computing and so on)
- A "View-class" which displays the results, directly or uses a "Template-Engine"
- Optionally, a "Template" managed from the chosen "Template-Engine" which is like an HTML-page with some TAGs
The system allows every class (Action or View) to call every other class. This will be done with an HTTP-redirect to avoid every problem generated by a Browser-"Refresh". Otherwise all data will be submitted again and maybe doubly inserted in the database.
The system is structured in classes to be derived (see documentation) to create your own Actions or Views. These base classes offer a very simple and flexible system to check user's data.
A subsystem of the Framework allows a simple management of the database (currently just MySQL and PostgreSQL implemented) with another check system for the data, before searching or inserting them.
The Controller manages a multilanguage system, based on GetText, and a right management system (see method hasUserRightForAction in the class Action). In addition it creates an array to be used as menu in all Views, with all Actions in which the method isMenuAction returns "true".
More information can be found in the documentation and in the examples that can be downloaded from the download page.
This Framework requires PHP version 5.2.4 or later and was tested on LAMP-systems although it should work on Windows and MAC, too.
Currently, the only implemented Template-Engine is based on Smarty, but it is possible to derive the class myMVC_BaseEngine to use another one.
This Framework will be distributed under the LGPL 2.1 license.