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

template tries to include itself

 
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
smartymoon
Smarty Rookie


Joined: 29 Apr 2003
Posts: 15

PostPosted: Wed May 25, 2005 2:55 pm    Post subject: template tries to include itself Reply with quote

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
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Wed May 25, 2005 3:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
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