|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
oleg_king Smarty n00b
Joined: 05 Jan 2013 Posts: 3
|
Posted: Sat Jan 05, 2013 10:52 pm Post subject: Assigning variables inside fetch() - from plugins |
|
|
Hello!
I'm using approach 'php from templates', not common 'templates from php'. So, when I call template fetch(), I have smarty object already initialized inside application.
I'm calling plugin load_module, that calls function from php and this function assigns data using global $smarty variable. In smarty 3.0.8 all worked fine, but when I was upgraded to latest 3.1.12, assigning of variables was broken.
In other words:
- initialize global $smarty
- call fetch()
- call get_page() PHP function inside of template via plugin load_module
- get_page calls $smarty->assign('PAGE', $page)
- fetch() do rest of magic implementing assigned variables into template text
- (in 3.0. I got fetched template with $PAGE assigned
- (in 3.1.12) I got fetched template WITHOUT $PAGE assigned
As I understand, assigning smarty variables via global smarty object does not works while fetching templates (it uses old copy of variables inside fetch()).
What should I do to assign variables that way using global $smarty object?
Thanks in advance! |
|
Back to top |
|
oleg_king Smarty n00b
Joined: 05 Jan 2013 Posts: 3
|
Posted: Sat Jan 05, 2013 11:42 pm Post subject: |
|
|
I forgot about this problem and have found my own topic about similar behavior:
http://www.smarty.net/forums/viewtopic.php?t=21141
Sorry for repeated question.
Workaround from that topic still works, so I just wanted to ask will this default behavior be modified in some of next releases (at least, as user choice)? Thanks! |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Jan 06, 2013 11:46 am Post subject: |
|
|
It will be modified with version 3.2 |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|