因此,使用单独功能的Im从使用所要求类别的人的类别中选取。 本职能
function catalogProductLink($product_id,$product_name,$categories=true) {
//This is the class that the function is called from
global $STATE;
if ($categories) {
//The $STATE->category_id is the property I want to access, which I can t
if (is_array($STATE->category_id)) {
foreach($STATE->category_id as $cat_id) {
if ($cat_id == 0) continue;
$str .= "c$cat_id/";
}
}
}
$str .= catalogUrlKeywords($product_name). -p .$product_id. .html ;
return $str;
}
这里是职能呼吁,该职能是在统计学会内部进行的。
$redirect = catalogProductLink($this->product_id, $tempProd->product_name, true, false);
The object that I need access to is the $STATE object that has been declared global. Prior to this function call there are lots of public properties populated, but when I look at the $STATE object within the function scope it loses all the properties but one, product_id. The property that matters for this function is the category_id property, which is an array of category id s.
我不禁要问,为什么我无法接触到美国统计局目标的所有公共财产,以及我如何获得这些财产。