下面是我的代码。相当笔直。只有默认条件正在执行。注释掉的 else if 语句确实有效。我试图用 switch 语句替换。
$currCat = (int)$_GET['cPath'];
switch ($currCat) {
case 4:
$tpl_page_body = '/tpl_product_info_display_threads.php';
case 1:
$tpl_page_body = '/tpl_product_info_display_canvas.php';
case 3:
$tpl_page_body = '/tpl_product_info_display_belts.php';
case 85:
$tpl_page_body = '/tpl_product_info_display_books.php';
case 75:
$tpl_page_body = '/tpl_product_info_display_beltsDEV.php';
default:
$tpl_page_body = '/tpl_product_info_display.php';
}
/*
if($currCat == 4) {
$tpl_page_body = '/tpl_product_info_display_threads.php';
} elseif ($currCat == 1) {
$tpl_page_body = '/tpl_product_info_display_canvas.php';
etc. etc. */
非常感谢你