Benefits of Using a PHP Framework
75Developing a Web Application
When you decide to develop a web application with a database back-end, rich user interface and complex business logic, a PHP framework can remove obstacles that stand in your way of solving the problem at hand. Stuff like user accounts, page security, group permissions, cross site scripting protection, character encoding, form validation, database connectivity and more are issues that need to be considered for most web applications. These things all have to be worked out in addition to the specifics of the application.
What Makes a Good PHP Framework
A good framework exposes classes and methods to increase productivity and overcome obstacles during development. It should have a security structure built in some way that allows you to specify what types of users or groups have access to certain pages and/or certain blocks of content within those pages. It should also provide a simple way to validate form input on both the client side and server side, as well as a way to display messages to the user when validation fails.
A good framework will most definitely have classes to connect to a database and represent records in arrays or objects for easy use in your scripts. Sometimes you will also have access to a code generator that parses your database schema and writes classes that are spefically mapped to tables in your database. Those classes can be quite useful, especially if you use foreign keys in your database to define relationships between the data objects. For example, if a customer table has column called order_id that is foreign keyed to the order table, a class generator can use that to write something like a method called get_orders() to retrieve orders made by that customer.
Another sign of a good framework is the availability of user interface components or widgets that do stuff like render smart grids with sorting, filtering and paging, or make buttons and links with event handlers to call server methods with AJAX functionality. UI components can save you tons of time you would otherwise spend writing loops and echoing table/tr/td everywhere or manually writing anchor tags everywhere.
Finally, a good framework never slows you down or makes things harder. If you spend more time configuring your framework or "fixing" it than you do solving the problem at hand, then you might be better served by looking to see what else is out there.
You can see a good comparison of popular PHP frameworks at http://phpframeworks.com/, or you can take a look at the Helix PHP Framework that I have developed over the past several years. Take some time to compare a few of them and read about the problems others have had before you dive in too deep with one of them. Good luck!
PrintShare it! — Rate it: up down flag this hub









