- Edited
So I've been coding in PHP here and there since early 2000's. I don't think I'm super good at it, but I get around a few things here and there and generally understand more challenging concepts, albeit only to be vexed by how I might implement them. I digress.
Anyway. So I've had this basic template for YEARS because I'm lazy, but it's worked for me so far in most situations.
<?php
/**
pull in HTML head up to < body > - mod stuff like meta and css links there */
require_once 'inc/dochead.inc.php';
/**
pull in HTML nav < ul > - nav is dynamically gen using readdir() */
require_once 'inc/nav.inc.php';
?>
<div id="maincol"><!-- ^ id:maincol ^ -->
<h2 id="doc_loc_href" title="currentUrlPath.pathInfoBasename"><?php print $currentUrlPath.$pathInfoBasename; ?></h2>
<!-- WHATEVER PAGE CONTENT HERE - PHP JAVASCRIPT - WHATEVER -->
</div><!-- $ id:maincol $ -->
<?php // PRINT #navlist ( array from ./inc/nav.inc.php )
foreach($htmlPrint as $htmlNavItem){
print $htmlNavItem;
}
?>
<!-- div id="displayHttPath">
<?php print $currentUrlPath.$pathInfoBasename; ?>
</div -->
<?php
/**
wrap it up */
require 'inc/footer.inc.php';
?>
</div><!-- $ id:wrapper $ -->
</div><!-- $ id:pagewidth $ -->
</body>
</html>
In fact, i've talked about that whole alphabetical file list thing before, and the community helped me with it.
So, considering the emphasis placed on having static pages for better SEO, etc.-- which I suppose is one of the reasons that React is so popular (although it is pretty cool), I wonder what impact using includes to build the HTML has (like in my example, i suppose), versus using a class, e.g.:
</div>
</div>
</section>
<?php
print $htmlclass->make_accordion();
print $htmlclass->make_footer();
?>
</body>
dont laugh
I probably turn green when I see discussion about how fast certain functions render content, etc. It's just not my cup of tea, but I realize it's important ultimately-- especially if dealing w/ .. how is it that someone said .. large amounts of data?
So that is my discussion topic here. How much should we care about page rendering speed, and how is it affected in my example, vs opting to use functions (i suppose more like you'd find in WP actions and such.)
(P.S. )What am I doing wrong w/ the markup here? I don't think I have such trouble elsewhere. Markdown, but the code
bits never seem to work for me, and always sans language-styled colors.