Search code examples
joomlamodulewhitespacejoomla-extensions

joomla blank space before module


I'm currently developing a custom module and for some reason it appends a blank space before anything I'm outputting. My set up is like this:

main class is in helper .php, logic is in mod_name .php, output is in /tmpl/default .php

The strange thing is that if I have a method in my class that returns html. And then I call this method in my template everything's fine no extra lines are appended. But if I try to write output, even plain text, in my template or mod_name.php I get this extra line.

Here's a screenshot: enter image description here

Please let me know if anyone encountered anything like this before, I'd be much obliged!


Solution

  • Turned out that the problem was because I was including 2 files, each of them contained a separate class, for some reason when I was including only 1 file it all worked fine. The included file had no white-space and wasn't generating any output, it contained only the logic. Thank You for your time and answers though.

    EDIT:

    Recently stumbled upon this issue again, turned out UTF-8 without BOM is the way to go, BUT MVC-wise, make sure that your components entry point "./com_helloworld/helloworld.php" is UTF-8 without BOM in the first place!