Authentification
Welcome! This is the sample application I wrote with my tiny MVC PHP framework, named Pastry, as a proof of concept. It allows you to explore a music database (that has been filled in by Scanlan, a small script written in Perl that is able to scan and index files).
Pastry is inspired by the Java framework Tapestry. The framework takes care of the C and the V layers from the MVC pattern. Additionally, a tiny ORM handles the M layer.
The framework is purely based on components. For example, this page is built using a component named "Border". It provides the header and the footer and is contains almost only pure HTML (except for the display of the generation timer and the queries counter in the footer). It also checks if the user is authenticated. If it's not the case, the "Border" displays another component named "Login" that contains a login form that you can see below.
Forms are a very interesting part of the framework. An automatic binding is created between the view and the controller for each input, so you don't have to manage the glue code to retrieve data from the form in the HTTP request. Components are assembled in the HTML and communicate through XML attributes. You'll find below the code required to build the login form.
Show code of the view
Show code of the controller
You can use "guest" as the login and the password to continue. Before that, do not hesitate to play with the form, like leaving one of the field blank or typing wrong credentials.