I have two PHP files, that are used as Views in an MVC-based application. Both of them contain mostly HTML, but also some variables sent to them by the Controller.
maintemplate.php:
<!DOCTYPE html>
<html>
<head>
<title><?php echo $viewModel->get('pageTitle'); ?></title>
</head>
<body>
<?php require($this->viewFile); //index.php ?>
</body>
</html>
index.php:
<ul>
<li><a href="fanfics/list">fanfics list</a></li>
</ul>
The problem is that the code shown in "View Source" (I checked Chrome, IE, and FF) is not nested as I would expect it to be. The first line is nested correctly - four spaces after the containing tag, but the other lines are nested as if the first line has no spaces before it at all.
View Source:
<!DOCTYPE html>
<html>
<head>
<title>Fanfiction application</title>
</head>
<body>
<ul> <!-- 4 spaces after the body -->
<li><a href="fanfic/list">fanfics list</a></li> <!-- No spaces after the body -->
</ul>
</body>
</html>
I tried to search on Google and on StackOverflow various variants of bad nesting view source, but none of the results seems to answer my question.
So how can I solved that? Thank you.