Reputation: 35700
For exmaple, I have 3 pages with the same structure:
banner
main content
footer
The banner
and footer
part are the same html, and main content
are different static html .
I don't want to copy the html code for banner
and footer
to each page which makes the refactor of code hard. And I don't want back-end output methods. Thanks.
Upvotes: 1
Views: 325
Reputation: 3792
I think the best answer so far was here:
Use
<?php include 'banner.html'; ?>
in a .php file and write the rest of it in static HTML. – Wesley Murch Aug 17 at 7:35
Technically, it's back-end code. But, technically, if nothing goes wrong, you won't have to bother back-end programmers. Keep your reusable static HTML in one place and call it when you need it.
Otherwise, I can't quite wrap my head around the idea of reusing server-side resources without calling on the back-end. It's basically a paradox.
Upvotes: 1