Replace static text in several files

0

I have a static website and I'm implementing some functions in php in it and one of them is to include a menu on all pages, which is already created and all the files are with it.

What I want is the following: replace all this code with: include menu.php

Is there any tool where I can do this? The menu code is the same for all files.

    
asked by anonymous 04.03.2014 / 17:40

1 answer

2

I do not know any tool to do this, what you can do is to copy the excerpt from the menu - if it is in HTML5, from <nav> to </nav> - and put it in a .php file if the menu is dynamic ( that is, it needs back-end processing) or .php or .html perhaps the menu is static (no need for Back-end processing) and use the include tag:

<?php 
   include("pasta/nomearquivo"); 
?>

If file name is "filename" and "folder" if the menu file is not in the main directory but in a subdirectory within it, otherwise use:

<?php
   include("nomearquivo");
?>
    
09.03.2014 / 01:59