Home > Backend Development > PHP Tutorial > ecmall action跳转有关问题

ecmall action跳转有关问题

WBOY
Release: 2016-06-13 10:59:34
Original
828 people have browsed it

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 不久,很困惑, 非常感谢你的帮助
------最佳解决方案--------------------

<br />/* 店铺分类 */<br />    function store()<br />    {<br />        /* 取得导航 */<br />        $this->assign('navs', $this->_get_navs());<br />        /* 取得商品分类 */<br />        $scategorys = $this->_list_scategory();<br />        /* 取得最新店铺 */<br />        $new_stores = $this->_new_stores(5);<br />        /* 取得推荐店铺 */<br />        $recommended_stores = $this->_recommended_stores(5);<br />        /* 当前位置 */<br />        $_curlocal=array(<br />            array(<br />                'text'  => Lang::get('index'),<br />                'url'   => 'index.php',<br />            ),<br />            array(<br />                'text'  => Lang::get('scategory'),<br />                'url'   => '',<br />            ),<br />        );<br />        $this->assign('_curlocal',$_curlocal);<br />        $this->assign('new_stores', $new_stores);<br />        $this->assign('recommended_stores', $recommended_stores);<br />        $this->assign('scategorys', $scategorys);<br /><br />        $this->assign('page_title', Lang::get('store_category') . ' - '. Conf::get('site_title'));<br />        $this->display('category.store.html');<br />
Copy after login

在drop()中也有类似的$this->assign('goods_list', $var);
类似于smarty的使用方式
------其他解决方案--------------------
没人2次开发 ecmall 吗? 顶一下

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template