|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
gordonisnz Smarty Regular
Joined: 05 Sep 2009 Posts: 70
|
Posted: Sat May 08, 2021 6:40 am Post subject: Problem with print_r |
|
|
Hello, I have a small problem with print_r
$array.$key|@print_r
when i look at this - the output is flushed to the left instead of being indented.. i cannot easily see any sub-arrays within it - Everything is flushed to the left. (even if I look at the HTML source)
im on Version 3.1.34-dev-7
any advice ? |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Tue May 11, 2021 6:20 pm Post subject: |
|
|
I made this experiment with Smarty 3.1.36:
where $Class is a multi-level array.
The HTML source looks like what print_r should look like.
The compiled template has this statement: Code: | echo print_r($_smarty_tpl->tpl_vars['Class']->value);?> |
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat May 15, 2021 11:38 am Post subject: |
|
|
1. $var|print_r:true
2. Indentation is a function of the user agent.
If you render to HTML, use HTML tags for presentation. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|