I have the following code which sets a variable as the contents of a file and then uses that variable in the template file.
$content = file_get_contents('./section_body.php');
include $_SERVER['DOCUMENT_ROOT'] . '/includes/template.php';
This was working fine until I added an include into section_body.php
. The contents of this include do not get rendered to the page.
Any ideas where I am going wrong?
Here's the code for section_body.php if it helps:
<?php
include $_SERVER['DOCUMENT_ROOT'] . '/controllers/category_list.php';
?>
<div>
<h1>Title</h1>
<p>dfg kjdfsghsd fkjghdjksfg jdhksfg kjsdfg hjskdf ghjsdfg kdhjsfg </p>
</div>