RE: $smarty not being registered in section loop

From: Date: Fri, 21 Dec 2001 16:47:25 +0000
Subject: RE: $smarty not being registered in section loop
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2364@lists.php.net to get a copy of this message
It appears that I can now not duplicate the error as I intended. In order to solve the problem, I changed my script to do a clear_compiled_tpl on top of setting compile_check to true. This, of course, flushed the compiled templates. Now that I have removed the above settings and am working with compile_check false, the scripts are running fine. I guess I accidentally installed the compiled templates alongside my new install on the production server. Compiled templates incompatibility! I am certain I can replicate the error if I installed the compiled templates from my win32 development environment. I suppose this would not be worthwhile, as this was an obvious error on my behalf, and not Smarty's. Michael -----Original Message----- From: Andrei Zmievski [mailto:andrei@ispi.net] Sent: December 21, 2001 9:28 AM To: Michael Caplan Cc: smarty@lists.ispi.net Subject: Re: [smarty] RE: $smarty not being registered in section loop What line are you getting the warning on? On Fri, 21 Dec 2001, Michael Caplan wrote: > I have located the problem. Why would $compile_check = false inhibit > $smarty to be registered in a section loop? > > Michael > > -----Original Message----- > From: Michael Caplan [mailto:dialectics-unlimited@sympatico.ca] > Sent: December 20, 2001 4:52 PM > To: smarty@lists.ispi.net > Subject: $smarty not being registered in section loop > > > Hi, > > I'm obviously missing something here, but I am having a problem with the > $smarty var being resisted as a index for a template. > > I just moved my script from my development environment (win32 php 4.1.0) to > a production box (freeBSD 4.4 php 4.06), and made all the appropriate > changes to the referenced paths. Under my development environment, the > script is running smoothly, but not under my production box. I have gone > through my code, several times, and can not come up with anything to explain > why the $smarty var is not being resisted. I was hoping that someone on > this list could help me rule out that this is a Smarty problem, but rather a > problem with my code. > > To be precise, $smarty is recognized as an index under normal circumstances, > but not in this one: > > I am calling a method from a script. This method is part of an class that > resides in an included file which is 2 directories above my script. No > problem. This method starts a new smarty session, assigns the vars, and > then fetches the processed template. No problem, sort of. The template > takes advantage of the $smarty var in a section loop -- > {$smarty.section.customer.index}. For a strange reason, smarty chokes on > this var and outputs: > "Notice Undefined index: smarty occurred in /to/template.php." > > Even stranger is that this method when executed in a script that resided > only one directory lower than the include file (the same directory that > houses the smarty templates and templates_c directory) works fine. The > $smarty var is registered properly, and I get my count returned when > fetching the template. > > What factors would contribute to the $smarty variable not to be registered > when a fetch or display method is called? > > Thanks for your time. > > Michael Caplan > Institute for Social Ecology > http://www.social-ecology.org/ > > 1118 Maple Hill Road > Plainfield, VT, 05667 USA > > General Tel. / Fax.: 1 (802) 454-8493 > > > --- > 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 "Everything is a matter of a little programming" -- Rasmus Lerdorf

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