HTML Output Class
Introduction
Not long ago, I got tired of passing certain common variables to every output function. So I decided to incorporate them into my output class instead. If you're familiar with the general layout of a typical output class, then what I'm about to present should make a lot of sense. I hope these examples will help you out along the way as you continue to contribute to the Mambo open source community.
The Old Way
Let's take a look at how the typical output class works. Normally, we call a function that collects the data we want displayed to the user. Then we call an HTML output class function to display the data.
The Logic
Here's a typical logic function. Notice how many variables are passed to the output function. In many cases, we always pass a few of the same variables to our output class. And each time we create a new output function, we have to remember to pass those same variables.
The Output
Here's a typical output class. And there's those pesky common variables again. They're the same for just about every output function we write. And they're a pain to keep up with if we have multiple output functions.
A New Way
Have you ever spent time debugging your code only to discover you left out one of those common variables? Or maybe it was in the wrong order in the function parameter list and all kinds of strange things happened in your output.
Enter a new HTML output class. We'll be adding some new features that will help you keep those common variables straight.
Click the link below to continue your journey.
HTML Output Class Redefined - The New Way