I use php as a template engine, and I noticed that when I include a view file, empty node text is added before the contents of this view.
For example, I have an html file that I want to include, having the following content:
<p>Some text</p>
than I include this file as follows:
<div><?php require_once('file/path.htm'); ?></div>
(note that I removed any spaces between div and php) And after php includes the file, it adds empty node text (which I will mark as this "), which adds a space before the p tag, so I get something- something like this:
Some previous content...
<div>
"" //empty text node
<p>Some text</p>
</div>
This is quite problematic because it destroys the composition of the content. Is there any solution for this?
source
share