Miscellaneous Code

  Home arrow Miscellaneous Code arrow Creating a Web Page Controller with th...
MISCELLANEOUS CODE

Creating a Web Page Controller with the HMVC Design Pattern
By: Alejandros Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2010-04-14

    Table of Contents:
  • Creating a Web Page Controller with the HMVC Design Pattern
  • Review: building different sections of a web page using the MVC pattern
  • Building a page controller and a master view
  • The sample application's full source code

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Creating a Web Page Controller with the HMVC Design Pattern


    (Page 1 of 4 )

    Welcome to the final installment of a series that shows you how to implement the Hierarchical Model-View-Controller design pattern in PHP 5. This series teaches you how to use the HMVC paradigm to develop an object-based framework whose core components can be easily tweaked and enhanced to suit your own programming requirements.

    And now that you know what to expect from this group of articles, I'd like to spend a few moments reviewing the topics that were discussed in the last one, in case you still haven't had the chance to look at it. In that tutorial I built a couple of MVC modules, aimed at independently rendering different sections of a basic web page.

    The first of these modules was tasked with dynamically constructing the navigation bar of the page, while that the second one was responsible for building its main section, which will display some fictional news previously fetched from a MySQL database table.

    Despite the simplistic and rather trivial nature of those MVC modules, also known commonly as MVC triads, they'll come in handy for demonstrating how a single HTTP request can be mapped to multiple controllers (two, for this sample project), thus implementing a hierarchical version of a regular MVC cycle.

    However, the area of responsibility of the corresponding MVC triads is limited to rendering only the aforementioned web page's sections -- in other words, the page's inner layout. Therefore, to render a finished version of this page, it's necessary to build a master template that acts like an "outer" layout.

    That's precisely what I'm going to do in this last part of the series. This process  will hopefully give you a truly spot-on idea of how to use the HMVC pattern in PHP 5.

    Now, let's leave the preliminaries behind and start coding that master web page layout!

    More Miscellaneous Code Articles
    More By Alejandros Gervasio

    blog comments powered by Disqus

    MISCELLANEOUS CODE ARTICLES

    - Creating a Web Page Controller with the HMVC...
    - Coding Controllers and Views for the HMVC De...
    - A Sample Web Application with the HMVC Desig...
    - Adding a Class to Parse Views to an HMVC Des...
    - Building a Model Class for the HMVC Design P...
    - Filtering Input Data and Generating HTML For...
    - The HMVC Design Pattern: Working with MySQL ...
    - Dispatching Requests to MVC Triads with the ...
    - Implementing the Hierarchical Model-View-Con...
    - A Web App Based on a Model for the CodeIgnit...
    - Completing a Model for the CodeIgniter PHP F...
    - Validating Input Data with the CodeIgniter P...
    - Deleting Database Records with the CodeIgnit...
    - Inserting Database Records with a CodeIgnite...
    - Fetching Database Rows with a Model for the ...


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap