RE: $smarty not being registered in section loop
| From: | Andrei Zmievski | Date: | Fri, 21 Dec 2001 14:27:52 +0000 |
| Subject: | RE: $smarty not being registered in section loop | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2361@lists.php.net to get a copy of this message | ||
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