For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > August 2004 > Re: [SMARTY] Assigning variables from resource plugins









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Assigning variables from resource plugins
Monte Ohrt

2004-08-20, 8:57 pm

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
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com