|
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 |
muhv Smarty n00b
Joined: 07 May 2003 Posts: 3
|
Posted: Wed May 07, 2003 12:32 pm Post subject: Two questions... |
|
|
Hi, I have 2 questions....
1. Can I some way insert smarty teplate tags to variable values. Example, I get content from DB what contains {xxxx} - tags in it. But how can I tell to Samrty that it will compile these tags too?
$smarty->assign('content', $fromDB);
$smarty->display('my.tpl');
This will output all tags without compiling them! Compiles only tags what are in template file not these what are in $fromDB ....
2. Can I somehow get list of all variables what are in template file. Not assigned variables.
Thanx. |
|
Back to top |
|
Brian Smarty Rookie
Joined: 29 Apr 2003 Posts: 21
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed May 07, 2003 11:38 pm Post subject: |
|
|
Hi muhv.
For the first part, it sounds like you want to {include} a template from your db. You can do this by writing a custom resource that fetches loads template data from your db instead of the filesystem.
See: http://smarty.php.net/manual/en/templates.from.elsewhere.php
As for your second question, if you mean, "Does Smarty have a function to return all variables used in a template" the answer is No. But if you use the object technique that Brain pointed you to, you can do something similar. |
|
Back to top |
|
muhv Smarty n00b
Joined: 07 May 2003 Posts: 3
|
Posted: Thu May 08, 2003 7:57 am Post subject: |
|
|
Great thanx!
This solution works for me ..... |
|
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
|