日期:2014-05-16  浏览次数:20501 次

ecshop 里面的$GLOBALS['smarty']->_var里面的_var是在哪定义的为什么是_var而不是其他?
比如下面这个foreach里面的  $GLOBALS['smarty']->_var['cat']['id']
<!--{foreach from=get_categories_tree(1) item=cat name=cat0}-->
<?php
$cat_info = get_cat_info_ex($GLOBALS['smarty']->_var['cat']['id']);
//var_dump( $cat_info );
?>
<!--{/foreach}-->

$GLOBALS['smarty']->_var['cat']['id']

_var 是在哪里定义的,而它后面的元素['cat']['id']是从foreach里面的item=cat拿的还是从 缓存文件里面拿的?

类似的还有
$GLOBALS['smarty']->_var['nav']['cid']
$GLOBALS['smarty']->_var['nav']['url']

$GLOBALS['smarty']->_var['goods_cat']['id']

$GLOBALS['smarty']->_var['category']

$GLOBALS['smarty']->_var['buy_goods']['last_price_no_format']
...
------解决方案--------------------
foreach里面的item=cat拿的

includes\cls_template.php 查找  function push_vars 里面有写