Re: [SMARTY] include template by smarty variable

From: Date: Fri, 04 Apr 2003 12:12:45 +0000
Subject: Re: [SMARTY] include template by smarty variable
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9054@lists.php.net to get a copy of this message
I don't understand what you exactly mean! can you explan it please?! I assign a smarty variable in my php-script name "$module_template". this variable contains the name of the template file (for example: index) without the fileending (.tpl)! in the {include} funktion I want to load the template file given by the php-script! {include file="modules/$module_template.tpl"} is the same as {include file="modules/index.tpl"} I think it's a probleme with the new smarty version! in my older version I never have such problems! "Monte Ohrt" <monte@ispi.net> wrote in message news:1049321906.23255.47.camel@lena.ispi.prv... > is your variable embedded in quotes named $module_template ? > > > On Thu, 2003-04-03 at 16:02, Sascha Willecke wrote: > > Hi, > > > > i get the folowing error by including an template with an smarty variable: > > > > Warning: Smarty error: unable to read template resource: "modules/i" in > > c:\apache\htdocs\includes\Smarty.class.php on line 999 > > > > my source: > > file = index.tpl > > ...some code... > > {if $module_template != ""} > > {include file="modules/$module_template.tpl"} > > {/if} > > ...some code... > > > > file = index.php > > $template->assign("module_template","index_index"); > > > > ...some code... > > > > $template->display("index.tpl"); > > > > whats wrong? > > > -- > Monte Ohrt <monte@ispi.net> >

« previous php.smarty.general (#9054) next »