Saturday, December 28, 2024

Debugging during Joomla development

If you write custom modules for Joomla it is often useful to get the output from an array. So normally you use

print_r($YourArray);

But this often kills your complete design and you need to remove that at some development point. A easier way would be to put the output from print into a variable and then output the variable to a comment section (so that it can be only view in a comment section):

$myDebugVar = print_r($yourArray, true);
echo '<!-- '.$myDebugVar.' -->';

Pretty easy or?

Please note that you must remove this above in the final version! Otherwiese everyone could get the content from your array, which could then lead to some first steps to hack your component!

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

35FollowersFollow
- Advertisement -

Latest Articles