Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Need to see what values are being passed in php

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
surreal5335
Smarty Rookie


Joined: 17 Jul 2012
Posts: 5

PostPosted: Mon Jul 30, 2012 7:50 pm    Post subject: Need to see what values are being passed in php Reply with quote

I have php logic that I need to see the variable values being passed, not to smarty, just inside the classes and setup php files.

It seems that smarty ignores die(), echo, and print_r()... so I am at a loss as to what I should do to debug my server side code.

Smarty is just telling me my variables assigned to smarty in the template_c folder are undefined. So I am trying to find out at what point my data is getting lost in the code.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7047
Location: Lincoln Nebraska, USA

PostPosted: Mon Jul 30, 2012 9:39 pm    Post subject: Reply with quote

A debugger like XDebug or ZendDebugger (and IDE) may be of great help in that area. Then you can step through code and watch variables. Otherwise you can print_r($foo) your variables to the screen when you want to check them?
Back to top
View user's profile Send private message Visit poster's website
surreal5335
Smarty Rookie


Joined: 17 Jul 2012
Posts: 5

PostPosted: Mon Jul 30, 2012 9:45 pm    Post subject: Reply with quote

so the print_r() statement does work in my logic files? I have tried but nothing I attempt to view on the screen from my logic files that doesnt go through smarty assignment doesnt show up.

I also read that smarty is designed to ignore such statements

Are there some side notes I should be aware of in order to make my echo's, print_r() and die() functions work? These are my primary form of debugging with php, that and error_reporting() but that one is working for me thankfully.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7047
Location: Lincoln Nebraska, USA

PostPosted: Mon Jul 30, 2012 10:09 pm    Post subject: Reply with quote

before you execute smarty, dump your variables and die right there. it should work, smarty cannot affect anything if you don't use it (?)
Back to top
View user's profile Send private message Visit poster's website
cl
Smarty Rookie


Joined: 05 Dec 2008
Posts: 12

PostPosted: Wed Aug 08, 2012 8:02 am    Post subject: Reply with quote

You should debug your PHP script line-by-line.
I suggest free PHP IDE Codelobster PHP Edition for it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    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