How to find any duplicate .tpl file is available in another directory by php?

56 Views Asked by At

I want to overwrite tpl file if same name tpl file is available in another directory.

for example like: -

main file is head.tpl

if same name tpl file is available in /overwrite/ folder then it should be show output from /overwrites/head.tpl

I know its possible by if i use

{if file_exists("{$path}/includes/head.tpl")}
  {include file="{$path}/includes/head.tpl"}
{else}
  the tpl file code 
{/if}

But for above I need to add this in each tpl file which i don't want, so i want use a function in PHP which read if same tpl file is exit in overwrites directory.

0

There are 0 best solutions below