<{* 類別管理 *}>
<{elseif $WEB.file_name == "admin_kind.php"}>
<{include file="tpl/admin_kind.tpl"}>
```
6.
二、使用
1. admin\_kind.php ```
#foreign key
$foreign = array(
"prod" => array("title" => "商品類別","stopLevel"=>1),
"news" => array("title" => "新聞類別","stopLevel"=>1),
"page" => array("title" => "頁面類別","stopLevel"=>1)
);
```
2. admin\_prod.php ```
#引入類別物件
include_once WEB_PATH . "/class/ugmKind.php";
#實體化 類別物件
$stopLevel = 1; //
$ofsn = 0;
$kind_tbl = "ugm_p_kind";
$kind_key = "prod";
//(資料表,分類,層數,父層)
$ugmKind = new ugmKind($kind_tbl, $kind_key, $stopLevel, $ofsn);
#---------------------------------
```
op\_form($sn)
```
global $db,$smarty,$ugmKind;
```
```
$row['kind'] = isset($row['kind']) ? $row['kind']: "";
# true : enable = 1 才顯示
$row['kind_options'] = $ugmKind->get_kindOption($row['kind'],true);
```
3.