Phpcms How to invoke such a conditional column?
The condition is: ParentID equals 1 of all columns, I want to tune out, do not know how to write AH
I write this:
{pc:content action= "category" Parentid= "1" num= "siteid=" $siteid "order=" Listorder ASC "}
{Loop $data $r}
{$r [catname]}
{/loop}
{/PC}
I can't tune it out.
------to solve the idea----------------------
/**
* Column Label
* @param $data
*/
Public function category ($data) {
$data [' catid '] = intval ($data [' catid ']);
$array = Array ();
$siteid = $data [' SiteID '] && intval ($data [' SiteID '])? Intval ($data [' SiteID ']): Get_siteid ();
$categorys = GetCache (' Category_content_ '. $siteid, ' Commons ');
$site = Siteinfo ($siteid);
$i = 1;
foreach ($categorys as $catid = = $cat) {
if ($i > $data [' Limit ']) break;
------to solve the idea----------------------
$siteid && $cat [' SiteID ']!= $siteid] continue;
if (Strpos ($cat [' url '], '://') = = = = False) {
$cat [' url '] = substr ($site [' Domain '],0,-1). $cat [' url '];
}
if ($cat [' ParentID ']== $data [' catid ']) {
$array [$catid] = $cat;
$i + +;
}
}
return $array;
}
From this tab implementation, there is no parentid parameter