Re: show_info_header() and show_info_include()

From: Date: Thu, 21 Mar 2002 14:17:57 +0000
Subject: Re: show_info_header() and show_info_include()
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3176@lists.php.net to get a copy of this message
No need to do this, $smarty->_current_file will contain the name of the template. On Thu, 21 Mar 2002, Manfred Wischin wrote: > Hi! > I think it is good that the two functions are replaced by a prefilter > options, but the simulating prefilter function needs to know the > template filename. > > I use the following function to simulate the old behavior > > function smarty_prefilter_showinfoheader($source, &$smarty, $tpl_file="") > { > return "<!-- Smarty include-start: $tpl_file -->".$source."<!-- > Smarty include-end: $tpl_file -->"; > } > > I modified Smarty_Compiler.class.php > > function _compile_file($tpl_file, $template_source, &$template_compiled) > { > [...] > // run template source through prefilter functions > if (count($this->_plugins['prefilter']) > 0) { > foreach ($this->_plugins['prefilter'] as $filter_name => > $prefilter) { > if ($prefilter[3] || function_exists($prefilter[0])) { > $template_source = $prefilter[0]($template_source, > $this, $tpl_file); > > ~~~~~~~~~~~~~ > $this->_plugins['prefilter'][$filter_name][3] = true; > } else { > $this->_trigger_plugin_error("Smarty plugin error: > prefilter '$filter_name' is not implemented"); > } > } > } > [...] > } > > It would be very nice, if that modification could be included into the > main tree. > thanx > cu > Manfred Wischin > > > > > --- > You are currently subscribed to smarty as: andrei@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -Andrei "The only true currency in this bankrupt world is what we share with each other when we're uncool." -- Lester Bangs, from the film 'Almost Famous'

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