Make PHP includes print their file location while in `dev` mode -



Make PHP includes print their file location while in `dev` mode -

we've seen websites code this:

<!-- begin /a4/includes/nav_include.php --> <div ... > <!-- end /a4/includes/nav_include.php -->

this sloppy , annoying, understand need able figure out file responsible source code you're seeing. i'd prefer way create included , required files automatically spit info out, when in toggleable dev mode.

obviously, this:

<?php if($devmode){ echo "<!-- begin /a4/include/snav_include.php -->"; } include("/a4/includesnav_include.php"); if($devmode){ echo "<!-- end /a4/includes/nav_include.php -->"; } ?>

but becomes annoying , sloppy on whole other level. i'd prefer best of both worlds, have functionality of above can still write includes this:

<?php include("/a4/includes/nav_include.php"); ?>

is there way this?

php include require require-once php-include

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -