By: Pirjo Posio
Date: 2007-09-24
Time: 19:48
|
Can subtemplate results be forwarded back to main php into a variable?Hi,
I've tried to use TBS main template + subtemplate combination for this: I want to store messages like this in a MySQL field:
But sometimes I don't want TBS to Show the result (echo), as it normally will. I am able to end the subtemplate by having the result in a variable. How can I get it back to the main php script in a variable? If subtemplate is not good for this, is there some other way? |
|
By: TomH
Date: 2007-09-24
Time: 22:13
|
Re: Can subtemplate results be forwarded back to main php into a variable?My Dear Ms Pirjo,
I haven't tested this with sub-scripts... but I have tricked my scripts with the export_plugin something like this
Maybe the basic idea of this export plugin will help somehow. |
|
By: Skrol29
Date: 2007-09-25
Time: 03:24
|
Re: Can subtemplate results be forwarded back to main php into a variable?Hi Pirjo,
Maybe you don't need subtemplates. You can just swap the current main template with another small template, do the merge with $TBS->Show(TBS_NOTHING) in order to ahve no output , and retreive the result with $TBS->Source. |
|
By: Pirjo Posio
Date: 2007-09-25
Time: 15:50
|
Re: Can subtemplate results be forwarded back to main php into a variable?Thank you so much, Skrol29, whose comment this time was the winner (applauds)!
TomH had an interesting comment also, and I can use that elsewhere, so thank you! I posted my solution to the Tips&Tricks Forum, in the same thread with other Multi-language stuff, since this solution can be used for language translation, as well as for other applications, where you possibly need variables inside strings and need to merge those separately from your main template. Here's the link: http://www.tinybutstrong.com/forum.php?msg_id=8195 |