|
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 |
smartymoon Smarty Rookie
Joined: 29 Apr 2003 Posts: 15
|
Posted: Wed May 25, 2005 2:55 pm Post subject: template tries to include itself |
|
|
I try to do the following.
code is
Code: | $smarty->fetch("blog.tpl"); |
blog.tpl is
Code: | {include file="blog.tpl"} |
Problem is
blog.tpl should be blog_body.tpl
but I omitted '_body'.
i.e. the template tries to include itself.
It caused Apache illegal operation error.
Can you do somthing in Smarty itself to prevent this mistake?
thanks,
s. moon |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed May 25, 2005 3:22 pm Post subject: |
|
|
There is no recursion tests in Smarty, and there is no limit to the number of includes you can go. Sometimes template recursion is desired.
You can make the same mistake in PHP and there is nothing to prevent it:
[php:1:d1c44fad0d]<?php include(__FILE__); ?>[/php:1:d1c44fad0d] |
|
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
|