On Sat, Feb 05, 2011 at 11:11:57AM -0500, [email protected] wrote:
> Morning everyone!
>
> I have a design question... No it's not about the interior of my
> house... although I could use some help with that as well...
>
> I am working on a framework for my own use (And maybe one day will
> beat out the popular frameworks! Hey I can dream right? :)) and to
> increase my knowledge.
>
> Here's my current index page:
>
> DJ_doctype("HTML4S");
> DJ_head("Double J FrameWork", $cfgCss, $cfgMeta);
> DJ_modules("navigation", "option");
> DJ_page("main_content.html", "mainContent");
> DJ_dbconnect($cfgDatabase);
>
> DJ_footer("copywrite", "Double J Web Design");
"Copywrite" should be "copyright" in this context.
>
> It all works perfectly but I'm starting to question having a bunch of
> function calls like that or should I simply have a big master
> DJ_displayPage() call?
Is this index page a front controller, or are there separate page
controllers? If the calls are all *identical*, then you can stuff them
into a single function call. The biggest problem with this is variable
visibility. You'll have to monitor that and decide if it's worth it. In
my case, I use page controllers where all the important variables are
declared. If I put a "render()" function at the bottom, I'd have to pass
in all those variables (on the stack) rather than simply have them
visible to the template page that I "include()" at the bottom of the
page controller.
>
> or should I have my framework create the html files? Has anyone gone
> down this road before? any pitfalls I should watch out for that aren't
> in google yet? :)
Some of this depends on your overall application architecture, which is
where the front contoller/page controller question above comes from.
Paul
--
Paul M. Foster
http://noferblatz.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php