Home arrow PHP arrow PHP MVC Frameworks: Building View Files

PHP MVC Frameworks: Building View Files

In this next-to-last part of the series, I finish building a MySQL-driven application that uses the functionality of the framework we've created to perform CRUD operations on a database table populated with user-related data.

  1. PHP MVC Frameworks: Building View Files
  2. Review: the user controller class
  3. Generating browser output with view files
  4. The sample application's files
By: Alejandro Gervasio
Rating: starstarstarstarstar / 2
July 07, 2010

print this article



Learning how to successfully implement a number of design patterns is definitely a great idea for PHP coders whose main goal is to develop solid and efficient web applications. This includes using the popular Model-View-Controller triad, or expressed in programming jargon, the MVC pattern.

True to form, this pattern is a helpful paradigm that will let you build programs that keep their application and business logic isolated from their visual presentation. This implies that they can be scaled up much more easily as they grow both in size and complexity.

However, grasping the theoretical concepts that surround the application of this pattern, especially in the terrain of web development, is only half of the whole learning process. It's necessary to demonstrate how it can be used in a real-world project as well.

This series of articles attempts to tackle this last point. It shows you how to leverage the power of the MVC design pattern to construct an extensible framework in PHP 5, which you can use as the starting point to create your own, or simply to understand more clearly the internal functioning of other well-consolidated frameworks available nowadays.

If you’ve reached this point you probably have an excellent idea not only of how to build a framework like the one mentioned above, but how to use many of its components for developing a basic MySQL-driven application capable of performing CRUD operations on a database containing records about some fictional users.

Speaking more specifically, I left off the last part of the series explaining how to build a controller class that first used the API of the framework’s model to run the aforementioned operations, and then to generate the appropriate outputs on the browser by way of a view class.

But as you’ll surely recall, the view files responsible for outputting formatted data to the screen weren’t created yet. In the next few lines I’m going to code them, so you can see how to use the HTML form helper class included in the framework.

Ready to tackle this penultimate installment of the series? Then begin reading now!

>>> More PHP Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: