For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > April 2005 > compiling database fields









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 compiling database fields
pete M

2005-04-14, 4:00 pm

This is the record in the database field and is stored in a snippets table

hello my name if {$contact.name} its {smarty.server.SERVER_NAME}

the snippets/contact is assigned in php but the tags are not processes,
instead they are output as straight text as...
tpl code
{section name=s loop=$snippets}
<div class="snippet">{$snippets[s].snippet}</div>
{/section}

the output is
hello my name if {$contact.name} its {smarty.server.SERVER_NAME}

How do I make smarty "compile it ", is there a quick and dirty methid
I'm missing ??

tia

pete
pete M

2005-04-14, 4:00 pm

Messju kindly answered this question on IRC with the {eval} function

ta
;-))))))))

pete M wrote:
> This is the record in the database field and is stored in a snippets table
>
> hello my name if {$contact.name} its {smarty.server.SERVER_NAME}
>
> the snippets/contact is assigned in php but the tags are not processes,
> instead they are output as straight text as...
> tpl code
> {section name=s loop=$snippets}
> <div class="snippet">{$snippets[s].snippet}</div>
> {/section}
>
> the output is
> hello my name if {$contact.name} its {smarty.server.SERVER_NAME}
>
> How do I make smarty "compile it ", is there a quick and dirty methid
> I'm missing ??
>
> tia
>
> pete

Sponsored Links







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

Copyright 2008 codecomments.com