how to use variable array in smarty tag?
| From: | zzz | Date: | Thu, 04 Sep 2003 05:55:05 +0000 |
| Subject: | how to use variable array in smarty tag? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10172@lists.php.net to get a copy of this message | ||
Hi all,
I'm trying to use a variable in the include smarty tag. I can get it to
work if the variable is $location but I want to use a variable that is like
this $config['location']. Does anyone know how to do this?
index.php
=========
<?php
SMARTY = new smarty();
$config['location'] = 'c:/www/app';
$SMARTY->assign('config', $config);
$SMARTY->display( 'template.tpl' );
?>
template.tpl
============
{include file="$config[location]/user_form.tpl"}
^^^^^^^^^^^^^^^^^