Re: show_info_header() and show_info_include()

From: Date: Thu, 21 Mar 2002 16:25:03 +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-3208@lists.php.net to get a copy of this message
I've fixed this for the next release. _current_file will be available to prefilters. On Thu, 21 Mar 2002, Manfred Wischin wrote: > Hi! > > I tried that, but although $_current_file is declared, it is empty. > A var_dump of the $smarty object shows no occurance of the tamplate > filename. > > I would like to use the debugging console, but since i am only using > fetch ist is not usable. > cu > Manfred > > Andrei Zmievski wrote: > > >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' > > > > > > > > > --- > 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 time from now until the completion of the project tends to become constant." -- Douglas Hartree

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