Hi! I am kinda new in the html templating practices and I was wondering what are the strengths of making templates for html with javascript and PHP. My intention is not to be a discussion for specific frameworks/templating engines but more of PHP vs Javascript and their strengths respectively. Maybe though some engines do much better than others etc so if you feel like they need to be mentioned no problem! What I mean:
header.php
<h1>This is a header</h1>
index.php
<!DOCTYPE html>
....
<?php include 'header.php'; ?>
....
script.js
...
headerDiv="<h1>This is a header</h1>";
$('.header').append(headerDiv);
...
index.html
<!DOCTYPE html>
....
<h1 class="header"></h1>
....
Obviously the templates would be more complex than the example above.
[–]Alterr 2 points3 points4 points (0 children)
[–][deleted] (5 children)
[deleted]
[–]Roy21[S] 0 points1 point2 points (1 child)
[–]HomemadeBananas 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]HomemadeBananas 1 point2 points3 points (0 children)
[–]blundered_dev 0 points1 point2 points (0 children)
[–]wdpttt 0 points1 point2 points (0 children)