$smarty not being registered in section loop
| From: | Michael Caplan | Date: | Thu, 20 Dec 2001 21:52:25 +0000 |
| Subject: | $smarty not being registered in section loop | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2342@lists.php.net to get a copy of this message | ||
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