Re: [SMARTY] {include} problem

From: Date: Tue, 18 Feb 2003 05:40:32 +0000
Subject: Re: [SMARTY] {include} problem
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7812@lists.php.net to get a copy of this message
Hi Steve, You could use a concat variable modifier Here is a post with an example of usage: http://marc.theaimsgroup.com/?l=smarty-general&m=104369240405348&w=2 Monte, This is trivial to write, but I did not see a copy posed in the contribs section, here is one if you want to post: <?php /* * Smarty plugin * ------------------------------------------------------------- * File: modifier.concat.php * Type: modifier * Name: concat * Version: 1.0 * Date: Feb 17th, 2003 * Purpose: pass value to concatenate and return result * Install: Drop into the plugin directory. * Author: Jason E. Sweat <jsweat_php@yahoo.com> * ------------------------------------------------------------- */ function smarty_modifier_concat($string, $add) { return $string.$add; } /* vim: set expandtab: */ ?> example template: {assign var=foo value="sometext"|concat:" othertext"} {$foo} Jason ----- Original Message ----- From: "Steve" <lists@iwsys.com> To: "Smarty General" <smarty-general@lists.php.net> Sent: Monday, February 17, 2003 10:52 PM Subject: [SMARTY] {include} problem > This worked before I updated to latest cvs: > > {include file=$template."/".$page.".tpl"} > > $template and $page are set and they work. This is broken after updating to > latest cvs. > > Error is: > > Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in > /var/www/html/bw/templates_c/%%157/%%1572547627/index.tpl.php on line 145 > > Applicable line is complied template is: > > <?php $_smarty_tpl_vars = $this->_tpl_vars; > $this->_smarty_include($this->_tpl_vars['template']."."/".".$this->_tpl_vars > ['page'].".".tpl"", array()); > $this->_tpl_vars = $_smarty_tpl_vars; > unset($_smarty_tpl_vars); > > Thanks, > > Steve > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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