Re: [SMARTY] Assigning variables from resource plugins
| From: | Monte Ohrt | Date: | Fri, 20 Aug 2004 23:07:31 +0000 |
| Subject: | Re: [SMARTY] Assigning variables from resource plugins | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11710@lists.php.net to get a copy of this message | ||
The smarty object should be available in the function, just $smarty_obj->assign('foo',$bar);
Jan H. Andersen wrote:
Hello, I've made a resource plugin that will allow me to read templates from a table in a database - nothing special in that. Along with the template-record I have som other data that I make available to the template with the assign-method. But when I use the include-function inside my templates (like {include file="db:/mytpl"} ) I want to be able to assign variables from the database record of "mytpl", so they are available when parsing mytpl. So, is it possible, and how, to assign variables to templates loaded by a smarty_resource_db_source function in a resource plugin ?. Best regards, Jan H. Andersen