Hi I am looking for a solution to give priority to File-B over File-A. Let me explain.
I am running Joomla and My template is in Blocks which are all imported and joined in the main index.php file.
Lets us say I have 2 folders FOLDER-A and FOLDER-B
FOLDER-A CONTENTS:
head.php
header.php
mainbody.php
footer.php
I am using the following function to get them to my index.php file:
function getBlock($filename){
require_once(YOURBASEPATH.DS.'FOLDER-A'.DS.$filename.'.php');
}
and I call them as:
<?php className::getBlock('head') ?>
<?php className::getBlock('header') ?>
<?php className::getBlock('mainbody') ?>
<?php className::getBlock('footer') ?>
Now I want to create an option of altering these core files without disturbing the original.
So if one wants to make changes to the Main Body then he copies the file mainbody.php to a filder called FOLDER-B and incorporates the changes there.
So what I am looking for is a function which checks FOLDER-B first and if a file with the same name of it’s counterpart as in FOLDER-A exists, then it must load that otherwise it should load the regular file from FOLDER-A.
Like:
?