views:

60

answers:

1

On a PHP site using the smarty template engine (or at least a close relative of smarty), I am calling a template include file ("header.html") which contains this code excerpt, along with other HTML omitted here for clarity:

<title>{$title|escape:"html"}</title>
{if isset($META) && $META}
    {foreach from=$META item=m}
        <meta name="{$m[0]}" content="{$m[1]}">
    {/foreach}
{/if}

I currently have this line in the parent page template:

{include file="header.html" title="My WebSite Title Goes here"}

If I want to change this line to add two META tags into my HTML, what is the right syntax to define the array which the header.html template is looking for?

Caveat: I'm unfamiliar with PHP, so I apologize if this is an obvious newbie question. Also, from some digging in the source code and from the comments below, I believe the site is using smarty for a template engine, although I can't be sure it's not a forked version.

+1  A: 

Try something like: in PHP:

$smarty->assign("myArray",array("some_key" => "some_value","key2" => "value2"));

in SMARTY:

{include file="header.html" title="your title" myParam=$myArray}
Zsolti
was hoping for a template-only solution, but I guess I can always use a {php} block around the code above.
Justin Grant