tags:

views:

32

answers:

2

Hi, I have some HTML errors in my output source code, coming from one of the .tpls. I'm wondering if there is a tool that is able to give me a list of .tpls that are used on the current page. I can't seem to find this error and the site isn't very well documented. I'm not the best PHP programmer, I'd be looking for an online resource or something pretty simple.

Thanks very much.

+1  A: 

The tpl files are template files, normally the actual code goes somewhere else in some php files. So you will have to search where this error is coming from, the least i can suggest is to put this in a file which is included in all files:

ini_set('display_errors', true);
error_reporting(E_ALL);
Sarfraz
Hi, thanks, but I'm looking for something different, there are some HTML comments coming from some .tpl file and I can't find it, the FTP content is huge, so I was hoping that there is a tool to find which tpls are used on a current page.
Kyle Sevenoaks
@Kyle Sevenoaks: It would be interesting to know if there is such tool :)
Sarfraz
+2  A: 

You can use the debugging console. This will show you all the included templates, assigned variables, and config file variables for the current page.

http://www.smarty.net/manual/en/chapter.debugging.console.php

Just set: $smarty->debugging = true; The next time you load a page a javascript window will pop up with all you want to know.

EDIT: I'm assuming that you're using smarty. If this is not the case, this answer is completely irrelevant.

thetaiko
Thanks very much :)
Kyle Sevenoaks
Just one more question, exactly how to I set smarty's debugging to true?
Kyle Sevenoaks
When you initialize Smarty, you set `$smarty = new Smarty;`. Just set `$smarty->debugging = true;` after that. As long as you call it before `$smarty->display();` you should be fine.
thetaiko
Thanks very much! :)
Kyle Sevenoaks