scoping: php file included by an included template
| From: | Paolo Nesti Poggi | Date: | Wed, 06 Aug 2003 14:14:39 +0000 |
| Subject: | scoping: php file included by an included template | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10008@lists.php.net to get a copy of this message | ||
Hi,
I guess I have a scoping problem. I used a lot of time to track it down but
I couldn't come up with a solution
In my template I'm including a subtemplate, the subtemplate includes a php
file with {include_php file='includedfile.php'}.
The php file gets it's job done and assignes some values to template
variables.
Everything fine until here.
The problems starts here as I cannot assign values to variables from this
script (doing for instance $extSmarty->assign('var',$output)).
As you see the script is not just an included script, it is included by an
included template.
I thought I could overcome scoping problems by declaring my extSmarty as
global in each file, however it seems not to be the case.
The strange thing to me is also that extSmarty from within the script does
work as expected to access paths of templates and the like, so it looks
like it is the same instance of smarty, but variables just don't get
assigned.
My questions are therefore:
do you know if this case is supposed to work,
do you have any idea of why it doesn't in my case
do you have an idea of what I could have overlooked
do you have any idea of what I could try to come closer to a solution
I hope really someone can help me 'cause I'm really stucked in this
Greets
Paolo