|
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 |
ky0 Smarty n00b
Joined: 09 Jun 2003 Posts: 3
|
Posted: Mon Jun 09, 2003 7:23 pm Post subject: random output |
|
|
I just downloaded the latest release of smarty and i am using it on a new project. After a few hours it starts putting random stuff on my pages.
a:3:{s:8:"template";a:2:{i:0;s:9:"blank.tpl";i:1;s:9:"blank.tpl";}s:9:"timestamp";i:1055134070;s:7:"expires";i:1055137670;} a:3:{s:8:"template";a:1:{i:0;s:9:"blank.tpl";}s:9:"timestamp";i:1055130420;s:7:"expires";i:1055134020;}
a:3:{s:8:"template";a:5:{i:0;s:9:"index.tpl";i:1;s:9:"index.tpl";i:2;s:9:"index.tpl";i:3;s:9:"index.tpl";i:4;s:9:"index.tpl";}s:9:"timestamp";i:1055133735;s:7:"expires";i:1055137335;} a:3:{s:8:"template";a:4:{i:0;s:9:"index.tpl";i:1;s:9:"index.tpl";i:2;s:9:"index.tpl";i:3;s:9:"index.tpl";}s:9:"timestamp";i:1055122036;s:7:"expires";i:1055125636;}
What does that mean? is that debug information? How can I fix this? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Jun 09, 2003 7:56 pm Post subject: |
|
|
Quote: | After a few hours it starts putting random stuff on my pages. |
I take it that you mean after a few hours of coding and not a few hours of site operation. What you are looking at are the results of the PHP serialize function which is used by Smarty in various places to aid caching features and such.
Are you using inserts? Config files? What version of PHP are you using? Probably the result of a syntax error in one of your templates--any way to narrow down what template code is triggering this?? |
|
Back to top |
|
ky0 Smarty n00b
Joined: 09 Jun 2003 Posts: 3
|
Posted: Mon Jun 09, 2003 8:23 pm Post subject: |
|
|
I am using php 4.2.3 no config file no inserts. some pages dont even have any smarty syntax in them at all. yes only a few hours coding not in deployment.
<BR><BR>
<FORM METHOD='post' ACTION='login.php'>
Username: <INPUT TYPE='text' NAME='username'><BR>
Password: <INPUT TYPE='password' NAME='password'><BR>
<INPUT TYPE='submit' VALUE='Login'>
</FORM>
<CENTER>
<TABLE>
<TR>
<TD><A HREF='{$add}' TARGET='body'>Add a Computer</A></TD>
<TD><A HREF='{$userinfo}' TARGET='body'>User Info</A></TD>
<TD><A HREF='{$messages}' TARGET='body'>Messages</A></TD>
<TD><A HREF='{$schedual}' TARGET='body'>Schedual</A></TD>
<TD><A HREF='{$logout}' TARGET='main'>Logout</A></TD>
</TR>
<TR>
<TD>Shelf</TD>
<TD>Bench</TD>
<TD>Pending</TD>
<TD>Complete</TD>
<TD>RFPU</TD>
</TR>
</TABLE>
</CENTER>
Very simple stuff. I turned caching off. When I make changes to data it does not reflect in the template itself. According to the FAQ, smarty is suppose to be smart enough and deterime when my template files should be compiled |
|
Back to top |
|
ky0 Smarty n00b
Joined: 09 Jun 2003 Posts: 3
|
Posted: Mon Jun 09, 2003 8:23 pm Post subject: |
|
|
I am using php 4.2.3 no config file no inserts. some pages dont even have any smarty syntax in them at all. yes only a few hours coding not in deployment.
<BR><BR>
<FORM METHOD='post' ACTION='login.php'>
Username: <INPUT TYPE='text' NAME='username'><BR>
Password: <INPUT TYPE='password' NAME='password'><BR>
<INPUT TYPE='submit' VALUE='Login'>
</FORM>
<CENTER>
<TABLE>
<TR>
<TD><A HREF='{$add}' TARGET='body'>Add a Computer</A></TD>
<TD><A HREF='{$userinfo}' TARGET='body'>User Info</A></TD>
<TD><A HREF='{$messages}' TARGET='body'>Messages</A></TD>
<TD><A HREF='{$schedual}' TARGET='body'>Schedual</A></TD>
<TD><A HREF='{$logout}' TARGET='main'>Logout</A></TD>
</TR>
<TR>
<TD>Shelf</TD>
<TD>Bench</TD>
<TD>Pending</TD>
<TD>Complete</TD>
<TD>RFPU</TD>
</TR>
</TABLE>
</CENTER>
Very simple stuff. I turned caching off. When I make changes to data it does not reflect in the template itself. According to the FAQ, smarty is suppose to be smart enough and deterime when my template files should be compiled |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Jun 09, 2003 8:41 pm Post subject: |
|
|
Hi again ky0.
hmmm. It does look strange. I took another look at your original post and on closer inspection, the serialize data looks very strange to me, especially all the repeated blank.tpl references.
You're right--your template looks harmless And you are also correct in assuming that Smarty should be updating those values in the output pages if your cache is off. Are the valules showing correctly in the debug window?
I'm a bit stumped:
- Are you using sessions?
- What does the relevant PHP code look like?
- Are you using different paths for your templates and templates_c directories?
---
FYI: You might consider using double quotes for your attribute values since XHTML allows nothing else. That's just my 2c, though |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Jun 10, 2003 12:04 am Post subject: |
|
|
@ky0: the output you show looks like cached-template-info. the multiple reference of "index.tpl" is due to a bug that is fixed in cvs. (see the thread @
http://marc.theaimsgroup.com/?l=smarty-dev&m=105272658911088&w=2 for reference).
the contents you show should never be generated with caching turned off. maybe you said "$smarty->caching = off;" literally in your app? this wouldn't work, and would turn on caching accidently, it should read "$smarty->caching = false;" (this is just wild guessing by me).
but i really don't know, what makes smarty output this internal data. a wild guess would be that you configured your cache-dir to be the same as your templates_c, but i would need to see some code to say more.
greetings
messju |
|
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
|