ecmall action跳轉問題
假如我有這麼一個跳轉 : index.php?app=goods&act=drop
他從 index.php -> ECMall 的 startup方法 -> 這時會請求 GoodsApp 這個類中的 do_action 方法, 因為這個類中沒有, 所以去找父類, 然後一個一個父親往上找 -> 直到找到 ECBaseApp 才出現第一個 do_action 方法, 但是他又 parent::do_action($action); -> 所以我又跑到 BaseApp 找, 總算不跳了, 但是$this->_run_action(); 也讓我傻眼:
function _run_action()
{
$action = $this->_curr_action;
$this->$action();
}
我輸出了這裡的 $action, 的確是 drop, 但是這個類中並沒有 drop(), 而且父類裡面也沒有 drop, 程式這時又跳到哪裡去了呢? 這時難道往下(子類)跳了嗎? 太奇怪了! 請PHP/ECMALL高手指點, 剛剛接觸 php 不久,很困惑, 非常感謝你的協助
------最佳解決方案--------------------
/* 店鋪分類 */
function store()
{
/* 取得導航 */
$this->assign('navs', $this->_get_navs());
/* 取得商品分類 */
$scategorys = $this->_list_scategory();
/* 取得最新店鋪 */
$new_stores = $this->_new_stores(5);
/* 取得推薦店鋪 */
$recommended_stores = $this->_recommended_stores(5);
/* 當前位置 */
$_curlocal=array(
array(
'text' => Lang::get('index'),
'url' => 'index.php',
),
array(
'text' => Lang::get('scategory'),
'url' => '',
),
);
$this->assign('_curlocal',$_curlocal);
$this->assign('new_stores', $new_stores);
$this->assign('recommended_stores', $recommended_stores);
$this->assign('scategorys', $scategorys);
$this->assign('page_title', Lang::get('store_category') . ' - '. Conf::get('site_title'));
$this->display('category.store.html');
在drop()中也有類似的$this->assign('goods_list', $var);
類似於smarty的使用方式
------其他解決方案--------------------
沒人2次開發 ecmall 嗎? 頂一下