Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

use DEBUG within tempalte?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
gordonisnz
Smarty Regular


Joined: 05 Sep 2009
Posts: 70

PostPosted: Sun Apr 03, 2022 3:02 am    Post subject: use DEBUG within tempalte? Reply with quote

Hi, I know when you use the debug command, It creates a POP-UP with all the smarty variables.

Is there a way to use the same function but WITHIN the template/html (no pop-up?)


IE, i found an error on a LIVE website, i want to quickly go in, & see the variables within the HTMl output (comments)

The web users wont see all the variables, but I can if i view source.

i can then fix the error/problem, without annoying pop-ups for the users...
i'll then remove it from the HTML output after all fixed
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Mon Apr 04, 2022 6:57 am    Post subject: Reply with quote

You might consider reviewing this:
Code:
https://www.smarty.net/docs/en/variable.debugging.ctrl.tpl

If you have access to the underlying script, you can setup the control to be true only on your IP address ($_SERVER["REMOTE_ADDR"]), to allow the URL invocation of the debug console.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Apr 06, 2022 11:27 am    Post subject: Reply with quote

I strongly recommend against debugging on live website, no matter the circumstances, as consequences could be dire.
With that warning considered, you could try something like
Code:
<!--
{<expression>|var_export:1|replace:">":"&gt;"}
-->
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP