0
是否可以在包含文件調用中使用包含文件調用作爲變量?是否可以在包含文件中使用包含文件作爲變量
下面是什麼,我需要一個例子:
{include file="data/data.inc.tpl" opts="{include file="data/dataset.inc.tpl"}"}
所以從dataset.inc.tpl
的信息被用作一個變量來從data.inc.tpl
是否可以在包含文件調用中使用包含文件調用作爲變量?是否可以在包含文件中使用包含文件作爲變量
下面是什麼,我需要一個例子:
{include file="data/data.inc.tpl" opts="{include file="data/dataset.inc.tpl"}"}
所以從dataset.inc.tpl
的信息被用作一個變量來從data.inc.tpl
沒有顯示各種選項,但你可以捕捉的內容包括在一個變量:
{capture name=dataset}
{include file="data/dataset.inc.tpl"}
{/capture}
{include file="data/data.inc.tpl" opts=$smarty.capture.dataset}
或傳遞給被包括
的文件名{include file="data/data.inc.tpl" opts='data/dataset.inc.tpl'}
,然後在data.inc.tpl ...
{capture name=dataset}
{include $opts}
{/capture}
感謝感激 – user2552985