• Luca Bertoncello

    Weidentalstraße 32

    01157 Dresden

    Germany

    Weidentalstraße 32   01157 Dresden   Germany

    lucabert@lucabert.de

     lucabert@lucabert.de

    >>> GPG-Key <<<

  • Luca Bertoncello
  • Seiten
    • Startseite
    • Download
    • Dokumentation

myMVC - Ein PHP-Framework, das das MVC-Paradigma implementiert


myMVC ist ein PHP-Framework, um das MVC-Paradigma (Model-View-Controller) zu implementieren.
Dieses System erlaubt eine komplette Trennung zwischen allem, was die Logik implementiert (Model) und allem, was die Datenanzeige implementiert (View).
Der Controller wird sich dann darum kümmern, diese Elemente miteinander zu verbinden.

Für jede Seite des Programms werden dann zwei oder mehrere Dateien angelegt:
  • Eine "Action-Klasse", die die gesamte Logik implementiert, um die Nutzerdaten zu prüfen und zu verwalten (Suche/Speichern/Löschen aus der Datenbank, Bearbeitung, usw.)
  • Eine "View-Klasse", die sich um die Anzeige der Daten kümmert, direkt oder mithilfe einer "Template-Engine"
  • Eventuell ein "Template", das mit der "Template-Engine" verwaltet wird und das am Ende nichts anderes als eine HTML-Seite mit einigen TAGs ist
Der Controller wird dann die richtige Klasse (Action oder View) aufrufen, je nachdem welche Anfrage der Nutzer geschickt hat oder was die vorige Action entschieden hat.
Das System erlaubt jeder Klasse (Action oder View), eine andere Klasse aufzurufen. Dieses wird mit einem HTTP-Redirect gemacht, so dass alle Probleme, die von einem "Refresh" des Browsers kommen, vermieden werden können (ansonsten wird die erste Action nochmal aufgerufen und die Daten nochmal geschickt).

Das System ist so gebaut, dass es mehrere Grundklassen gibt (siehe Dokumentation), von denen man seine eigene Action oder View ableitet. Diese Klassen bieten ein sehr flexibles System, um die Nutzerdaten zu prüfen.
Ein Untersystem des Frameworks ermöglicht eine einfache Verwaltung einer Datenbank (aktuell nur MySQL und PostgreSQL implementiert) mit einem weiteren Datenprüfsystem vor einer Suche oder Speicherung der Daten.
Der Controller verwaltet auch ein mehrsprachiges System (auf GetText basiert) sowie ein Rechteverwaltungssystem (siehe Methode hasUserRightForAction der Klasse Action). Dazu legt er ein Array an, das in einer View als Menü anzuzeigen ist, mit allen Actions, bei der die Methode isMenuAction "true" zurückgibt.

Weitere Informationen befinden sich in der Documentation und in den Beispielen, die von der Downloadseite herunterzuladen sind.

Das Framework erfordert PHP ab Version 5.2.4 und wurde auf einem LAMP-System getestet, obwohl es auch unter Windows und MAC funktionieren sollte.
Zur Zeit wurde nur eine Template-Engine implementiert, und zwar für Smarty. Es ist aber möglich, die Klasse myMVC_BaseEngine zu verzweigen, um ein anderes System zu nutzen.

Dieses Framework wird unter der Lizenz LGPL 2.1 zur Verfügung gestellt.
  • Pages
    • Start page
    • Download
    • Documentation

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 Controller will call the right class (Action or View) depending on the user's request or what the previous Action decided.
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.
  • Pagine
    • Pagina principale
    • Download
    • Documentazione

myMVC - Un Framework PHP per implementare il paradigma MVC


myMVC è un Framework PHP per implementare il paradigma MVC (Model-View-Controller).
Questo sistema consente una completa separazione tra ciò che è la logica (Model) e ciò che è la visualizzazione dei dati (View).
Il Controller si occupa di gestire la comunicazione tra questi elementi.

Per ogni pagina dell'applicazione esistono quindi due o più files:
  • Una "classe Action", che contiene tutta la logica per controllare i dati immessi e gestirli (ricerca/inserimento/cancellazione nel database, elaborazione, etc.)
  • Una "classe View", che si occupa di visualizzare i risultati, direttamente o tramite l'uso di un "Template-Engine"
  • Eventualmente un "Template", da gestire con il "Template-Engine" prescelto, che è fondamentalmente una pagina HTML con alcuni TAGs
Il Controller si occupa quindi di richiamare la giusta classe (Action o View) a seconda della richiesta dell'utente o di quanto una Action ha deciso.
Il sistema consente ad una qualsiasi classe (Action o View) di richiamare una qualsiasi altra classe. Questo viene fatto con un redirect a livello HTTP, in modo da evitare i problemi legati ad un eventuale uso del "Refresh" del Browser (che altrimenti richiamerebbe la Action iniziale con un eventuale reinserimento dei dati giä immessi).

Il sistema è strutturato in classi da derivare (vedi la documentazione) per creare le proprio Action e View. Queste classi base offrono anche una sistema molto flessibile per il controllo dei dati immessi dall'utente.
Un sottosistema del Framework consente una gestione molto facile del database (attualmente implementati sono i motori MySQL e PostgreSQL), con un ulteriore sistema di controllo dei dati prima di una ricerca o di un salvataggio.
Il Controller gestisce anche un sistema multilingua basato su GetText ed una gestione di permessi completamente trasparente all'utente (vedi il metodo hasUserRightForAction nella classe Action). Inoltre crea un array contenente un menu da poter visualizzare nelle View, con tutte le Action il cui metodo isMenuAction ritorna true.

Maggiori informazioni si trovano nella documentazione e negli esempi, disponibili nella pagina di Download.

Il Framework richiede PHP a partire dalla versione 5.2.4 ed è stato testato su un sistema LAMP, sebbene dovrebbe funzionare anche su Windows e MAC.
Attualmente l'unico Template-Engine implementato è Smarty, ma è possibile derivare la classe myMVC_BaseEngine ed usarne un altro a piacere.

Questo Framework viene distribuito sotto licenza LGPL 2.1.