Quantcast
Channel: WHMCS Community Forums
Viewing all articles
Browse latest Browse all 13458

Variable from a TPL file

$
0
0
Hi to all.
I need to read a varible, an array contained in a tpl file, into another tpl file. This is my actually code.
the file with the array (my-list.tpl):
Code:

{php}
$my_list = Array();
$my_list[0]['name'] = 'pluto';
$my_list[1]['name'] = 'pippo';
$this->assign('my_list_tmp',$my_list);
{/php}
{$my_list_tmp.0.name}
{assign var="my_list" value=$my_list_tmp scope=parent}

the main file:
Code:

{include file="$template/my-list.tpl"}
{$my_list.0.name}

Unfortunally the value of the variable my_list in the main file remain NULL. How can i fix it?
Help me plz. Thank in advice.

Viewing all articles
Browse latest Browse all 13458

Trending Articles