Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Including Other TPL Files
Goto page Previous  1, 2
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
Smarty Rookie

Joined: 06 Jul 2003
Posts: 23
Location: France

PostPosted: Mon Oct 27, 2003 5:21 pm    Post subject: include problem Reply with quote

i don't know if it was the same problem but i find that in version 2.6.0-RC1 when you include a template from another dir than the include one and the default include dir it could failed with no error

in my template i include from a template file which was in temlates dir an extern template with this syntax
{include file=$frame1}

$frame1 was setted like this where $tplPath is a php local var to the path of my doc
$page -> assign("frame1","{$tplPath}test.tpl");

nothing was shown on screen no error and not my template, which was correctly assigned in template vars, the compiled file of my template (test.tpl) contain nothing except the smarty comment.

i finally find out that i achieve an error in filename and so smarty couldn't find the template assigned in frame1

thus i have changed both _compile_file in smarty_compiler.class
and _fetch_resource_info in smarty.class
to check if content returned by the readed template isn't empty
(a fast dirty hack)
if (strlen($source_content) == 0) {
die ("problem with [{$resource_name}] content is empty");


if (strlen($params['source_content'])==0) {
die ("error file [$_resource_name] is empty");

perhaps it could help you !

froggies forever.... Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Goto page Previous  1, 2
Page 2 of 2

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